Skip to content

Commit

Permalink
Django 1.8: Fix tests and admin_url
Browse files Browse the repository at this point in the history
  • Loading branch information
darklow committed Apr 22, 2015
1 parent ddf268f commit 368f54b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion suit/templatetags/suit_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def field_contents_foreign_linked(admin_field):

@register.filter
def admin_url(obj):
info = (obj._meta.app_label, obj._meta.module_name)
info = (obj._meta.app_label, obj._meta.object_name.lower())
return reverse("admin:%s_%s_change" % info, args=[obj.pk])


Expand Down
15 changes: 7 additions & 8 deletions suit/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django.test.simple import DjangoTestSuiteRunner
from suit.tests.templatetags.suit_menu import SuitMenuTestCase, \
SuitMenuAdminRootURLTestCase, SuitMenuAdminI18NURLTestCase, \
SuitMenuAdminCustomURLTestCase
Expand All @@ -10,6 +9,13 @@
from suit.tests.utils import UtilsTestCase


try:
# Django 1.7+
from django.test.runner import DiscoverRunner as DjangoTestSuiteRunner
except ImportError:
from django.test.simple import DjangoTestSuiteRunner


class NoDbTestRunner(DjangoTestSuiteRunner):
"""A test suite runner that does not set up and tear down a database."""
def setup_databases(self):
Expand All @@ -21,12 +27,5 @@ def teardown_databases(self, *args):
pass


try:
# Django 1.7+
from ddjango.test.runner import DiscoverRunner as DjangoTestSuiteRunner
except ImportError:
from django.test.simple import DjangoTestSuiteRunner


class SuitTestRunner(DjangoTestSuiteRunner):
pass

0 comments on commit 368f54b

Please sign in to comment.