Commits

Will Emmerson committed c301ecd

make tests work with newer version of Django and add readme

Comments (0)

Files changed (4)

easy_maps_tests/README.rst

+django-easy-maps test project
+=================================
+Project to reproduce errors for others to debug it.
+
+Installation
+============
+
+::
+
+    cd easy_maps_tests
+    mkvirtualenv django-easy-maps-test
+    pip install -r requirements.txt
+    ./manage.py syncdb
+    ./manage.py migrate
+    ./manage.py test
+    ./manage.py runserver
+
+

easy_maps_tests/manage.py

 #!/usr/bin/env python
-from django.core.management import execute_manager
-try:
-    import settings # Assumed to be in the same directory.
-except ImportError:
-    import sys
-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
-    sys.exit(1)
+import os, sys
 
 if __name__ == "__main__":
-    execute_manager(settings)
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
+
+    from django.core.management import execute_from_command_line
+
+    execute_from_command_line(sys.argv)

easy_maps_tests/requirements.txt

+Django
+South
+geopy
+mock

easy_maps_tests/runtests.py

-#!/usr/bin/env python
-import sys
-from django.core.management import execute_manager
-import settings
-
-sys.argv.insert(1, 'test')
-
-if len(sys.argv) == 2:
-    sys.argv.append('easy_maps')
-    sys.argv.append('test_app')
-
-if __name__ == "__main__":
-    execute_manager(settings)
-