Skip to content

Instantly share code, notes, and snippets.

@brantz
Created December 5, 2012 13:59
Show Gist options
  • Save brantz/4215701 to your computer and use it in GitHub Desktop.
Save brantz/4215701 to your computer and use it in GitHub Desktop.
the webtest test
#encoding: utf-8
from webtest import TestApp
from webtest.debugapp import debug_app
from server import Server
import unittest
class ErrorMailerTest(unittest.TestCase):
def test_minimal_request(self):
self.app = TestApp(Server)
self.response = self.app.post('/mailer')
self.response = self.server.post(
'/mailer', {
'subject' : 'test subject',
'content' : 'test content'
}
)
self.assertTrue(self.response.status == 200)
if __name__ == '__main__':
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment