Created
November 29, 2011 19:20
-
-
Save jeanphix/1406053 to your computer and use it in GitHub Desktop.
django testing with ghost.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import os | |
import django.core.handlers.wsgi | |
from ghost import GhostTestCase | |
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' | |
app = django.core.handlers.wsgi.WSGIHandler() | |
class MyTest(GhostTestCase): | |
port = 5000 | |
def create_app(self): | |
return app | |
def test_open_home(self): | |
page, ressources = self.ghost.open("http://localhost:%s/" % self.port) | |
self.assertEqual(page.http_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