Carl Meyer committed dcff929 Draft

Update test project.

  • Participants
  • Parent commits 9ed2496

Comments (0)

Files changed (5)

File test_project/README.txt

 A bare-bones Django project for live-testing django-adminfiles; particularly
 Javascript functionality that can't easily be unit-tested.
-If I get really ambitious one day I might stick some Selenium scripts in
+Run ``pip install -r requirements.txt`` to install all the dependencies you
+need into a virtualenv; then run ``./`` to set up a test
+database and run the test server on ``http://localhost:8000``.
+Use admin/admin to log into the admin of the test server.
+Ideally we'd have Selenium tests for this stuff.

File test_project/

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

File test_project/requirements.txt

+-e ..

File test_project/

 ./ syncdb --noinput
-pushd media
-ln -s ../../adminfiles/media/adminfiles .
+pushd static
+ln -s ../../adminfiles/static/adminfiles .
 ./ runserver
 rm adminfiles-test.db
-rm media/adminfiles
+rm static/adminfiles
+rm -rf media/*

File test_project/

-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url, include
 from django.conf import settings
-from django.contrib.staticfiles.urls import staticfiles_urlpatterns
 from django.conf.urls.static import static
 from django.contrib import admin
 urlpatterns = patterns('',
-    (r'', include(,
-    (r'^adminfiles/', include('adminfiles.urls')),
-if settings.DEBUG:
-    urlpatterns += staticfiles_urlpatterns()
-    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
+    url(r'', include(,
+    url(r'^adminfiles/', include('adminfiles.urls')),
+) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)