Commits

Lukas Linhart committed f759874

Add support for self.fail

Comments (0)

Files changed (2)

djangosanetesting/cases.py

     make_translations = True
     
     SkipTest = SkipTest
+
+    failureException = AssertionError
     
     def _check_plugins(self):
         if getattr(self, 'required_sane_plugins', False):
         assert_false(*args, **kwargs)
     
     assertFalse = assert_false
-    
+
+    def fail(self, *args, **kwargs):
+        self.failureException(*args, **kwargs)
+
     def tearDown(self):
         pass
 

testproject/test/test_unit.py

     def test_equals_false(self):
         self.assert_raises(AssertionError, lambda:self.assert_equals(1, 2))
 
+    def test_fail(self):
+        try:
+            self.fail()
+        except AssertionError:
+            pass
+
 class TestUnitAliases(UnitTestCase):
     
     def get_camel(self, name):