Skip to content

Commit

Permalink
add preliminary tests
Browse files Browse the repository at this point in the history
  • Loading branch information
crccheck committed Oct 20, 2012
1 parent bd23a60 commit ff84fc2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ help:


test:
python $(PROJECT)/manage.py test
#
# -s don't capture stdout
#
python $(PROJECT)/manage.py test -s


resetdb:
Expand Down
20 changes: 20 additions & 0 deletions example_project/test_app/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from django.test import TestCase


class LoggedInTestCase(TestCase):
def setUp(self):
super(LoggedInTestCase, self).setUp()
self.client.login(username='admin', password='admin')


class AppTests(LoggedInTestCase):
def test_bare_mixin_works(self):
# hit admin that doesn't have any tools defined, just the mixin
response = self.client.get('/admin/polls/poll/add/')
self.assertEqual(response.status_code, 200)

def test_configured_mixin_works(self):
# hit admin that does have any tools defined
response = self.client.get('/admin/polls/choice/add/')
self.assertEqual(response.status_code, 200)
self.assertIn('objectactions', response.context_data)

0 comments on commit ff84fc2

Please sign in to comment.