Commits

Mikhail Korobov committed 7c2232e

self.assertTemplateUsed and self.assertTemplateNotUsed API is supported

  • Participants
  • Parent commits 765e555

Comments (0)

Files changed (1)

django_webtest_tests/testapp_tests/tests.py

         self.assertEqual(response.context['bar'], True)
         self.assertEqual(response.context['spam'], None)
 
+    def test_django_assert_api(self):
+        response = self.app.get('/template/index.html')
+        self.assertTemplateUsed(response, 'index.html')
+        self.assertTemplateNotUsed(response, 'complex.html')
+
+        complex_response = self.app.get('/template/complex.html')
+        self.assertTemplateUsed(complex_response, 'complex.html')
+        self.assertTemplateUsed(complex_response, 'include.html')
+        self.assertTemplateNotUsed(complex_response, 'foo.html')
+
 
 class AuthTest(WebTest):
     def setUp(self):