Commits

Mikhail Korobov committed c96762e

Fix tests from previous commit

  • Participants
  • Parent commits cc8d57b

Comments (0)

Files changed (1)

test_proj/test_app/tests.py

         self.assertNotContains(res, 'Users')
 
         self.assertTrue(self.client.login(username='superuser', password='123'))
-        self.assertContains(self.client.get('/admin/'), 'Users')
+        res = self.client.get('/admin/')
+        self.assertContains(res, 'Users', 2) # menu and dashboard items
 
     def test_app_index(self):
         self.client.login(username='staff', password='123')
-        res = self.client.get('/admin/test_app/foo/')
+        res = self.client.get('/admin/test_app/')
         self.assertEqual(res.status_code, 200)
         self.assertContains(res, 'Foos')
         self.assertNotContains(res, 'Bars')
 
         self.client.login(username='superuser', password='123')
-        res = self.client.get('/admin/test_app/foo/')
+        res = self.client.get('/admin/test_app/')
         self.assertContains(res, 'Foos')
-        self.assertContains(res, 'Bars')
+        self.assertContains(res, 'Bars')
+        self.assertContains(res, 'Users', 1) # only item from menu