Permalink
Browse files

Update test project to modern project layout

  • Loading branch information...
1 parent cdf74ca commit d14a5edd8890afab0fbb7a5f63bc503a8e3a137c @nkuttler committed Feb 17, 2013
View
@@ -1,10 +1,5 @@
-.PHONY: test
-test: db.sqlite
- python manage.py test --failfast --settings=test_project.settings_multicode
- python manage.py test --failfast
-
-db.sqlite:
- python manage.py syncdb --noinput
+test:
+ make -C test_project test
.coverage:
coverage run --source=webmaster_verification manage.py test
@@ -0,0 +1,4 @@
+.PHONY: test
+test:
+ python manage.py test --failfast --settings=test_project.settings_multicode
+ python manage.py test --failfast
@@ -1,9 +1,10 @@
#!/usr/bin/env python
import os
import sys
-from django.core.management import execute_from_command_line
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings")
- sys.path.insert(0, os.path.abspath('%s/..' % os.getcwd()))
+
+ from django.core.management import execute_from_command_line
+
execute_from_command_line(sys.argv)
@@ -1,6 +1,6 @@
import os
-TESTS_DIR = os.getcwd()
+TESTS_DIR = os.path.dirname(os.getcwd())
DEBUG = True
TEMPLATE_DEBUG = True
@@ -1,14 +1,4 @@
-import sys
-
-from django.utils.importlib import import_module
-
-
-# Import default settings
-settings_default = import_module('test_project.settings')
-settings_multicode = sys.modules[__name__]
-for key in dir(settings_default):
- if not key.startswith('__'):
- setattr(settings_multicode, key, getattr(settings_default, key))
+from settings import *
# And override what we want
WEBMASTER_VERIFICATION = {
@@ -1,8 +1,5 @@
from django.conf.urls.defaults import patterns, include, url
-from django.views.generic import TemplateView
-from webmaster_verification.views import BingVerificationView
-
urlpatterns = patterns('',
url(r'', include('webmaster_verification.urls')),
)

0 comments on commit d14a5ed

Please sign in to comment.