David Bennett avatar David Bennett committed f7ec3f2

Whew… finally got coverage working… I think.

Comments (0)

Files changed (4)

private_media/test_settings.py

 
 INSTALLED_APPS = (
     'django.contrib.contenttypes',
-    'django.contrib.sites',
     'django.contrib.auth',
-    'django.contrib.admin',
     'private_media',
     'private_media.tests',
     'django_jenkins',
 )
 
+PROJECT_APPS = (
+    'private_media',
+)
+
 JENKINS_TASKS = (
-    'django_jenkins.tasks.run_pyflakes',
-    'django_jenkins.tasks.run_pep8',
     'django_jenkins.tasks.with_coverage',
     'django_jenkins.tasks.django_tests',
+    'django_jenkins.tasks.run_pep8',
+    'django_jenkins.tasks.run_pyflakes',
 )

private_media/tests/__init__.py

-from .tests import FileTests
+from django.conf import settings
+
+if 'private_media.tests' in settings.INSTALLED_APPS:
+    from .tests import FileTests

private_media/tests/tests.py

     def test_file_url(self):
         obj = PrivateStorage.objects.get(normal="tests/django_test.txt")
         self.assertEqual(
-            obj.normal.url, "/media/OC8xL25vcm1hbA/tests/django_test.txt")
+            obj.normal.url, "/media/Ni8xL25vcm1hbA/tests/django_test.txt")
 
     def test_file_get_no_auth(self):
-        got = self.client.get("/media/OC8xL25vcm1hbA/tests/django_test.txt")
+        got = self.client.get("/media/Ni8xL25vcm1hbA/tests/django_test.txt")
         self.assertIsInstance(got, HttpResponseForbidden)
 downloadcache = {toxworkdir}/_download/
 setenv =
     DJANGO_SETTINGS_MODULE = private_media.test_settings
+changedir = {toxworkdir}
 commands =
-    {envbindir}/python {envbindir}/django-admin.py jenkins {posargs:private_media}
+    {envbindir}/python {envbindir}/django-admin.py jenkins
 deps =
     Django==1.3.1
-    coverage
     django-jenkins
     pep8
     pyflakes
-    unittest2
 
 [testenv:docs]
 basepython = python2.7
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.