File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
tests/regressiontests/test_client_regress Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,23 @@ class AssertContainsTests(TestCase):
1010 def test_contains (self ):
1111 "Responses can be inspected for content, including counting repeated substrings"
1212 response = self .client .get ('/test_client_regress/no_template_view/' )
13-
13+
14+ self .assertContains (response , 'never' , 0 )
1415 self .assertContains (response , 'once' )
1516 self .assertContains (response , 'once' , 1 )
1617 self .assertContains (response , 'twice' )
1718 self .assertContains (response , 'twice' , 2 )
1819
20+ try :
21+ self .assertContains (response , 'never' , 1 )
22+ except AssertionError , e :
23+ self .assertEquals (str (e ), "Found 0 instances of 'never' in response (expected 1)" )
24+
25+ try :
26+ self .assertContains (response , 'once' , 0 )
27+ except AssertionError , e :
28+ self .assertEquals (str (e ), "Found 1 instances of 'once' in response (expected 0)" )
29+
1930 try :
2031 self .assertContains (response , 'once' , 2 )
2132 except AssertionError , e :
You can’t perform that action at this time.
0 commit comments