Skip to content

Commit

Permalink
Added test for templates used
Browse files Browse the repository at this point in the history
  • Loading branch information
specialunderwear committed Sep 4, 2011
1 parent cc70b84 commit 21b71df
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions easymode/tests/testcases/testoldrelatedadmin.py
Expand Up @@ -8,10 +8,10 @@
from easymode.tree.admin.widgets import foreignkey


__all__ = ('TestRelatedAdmin',)
__all__ = ('TestOldRelatedAdmin',)

@initdb
class TestRelatedAdmin(TestCase):
class TestOldRelatedAdmin(TestCase):

fixtures = ['auth-user']

Expand Down
21 changes: 18 additions & 3 deletions easymode/tests/testcases/testrelatedadmin.py
Expand Up @@ -4,9 +4,24 @@
from easymode.tests.testcases import initdb


__all__ = ('TestL10nForm',)
__all__ = ('TestRelatedAdmin',)

@initdb
class TestL10nForm(TestCase):
class TestRelatedAdmin(TestCase):
fixtures = ['auth-user', 'tests-top-bottom']


def test_the_tree_templates_get_called(self):
"the tree templates should be called for models with tree admins"

if self.client.login(username='admin', password='admin'):
url = reverse('admin:tests_topmodel_change', args=[1])
response = self.client.get(url)

self.assertTemplateUsed(response,'tree/admin/edit_inline/link_inline.html')
self.assertTemplateUsed(response, 'tree/admin/widgets/add_widget.html')
self.assertTemplateUsed(response, 'tree/admin/widgets/link_widget.html')
else:
self.fail('Can not login with admin:admin')



0 comments on commit 21b71df

Please sign in to comment.