from django.test import TestCase class SimpleTest(TestCase): ''' Your unit tests go here ''' def test_a(self): pass def run(self, result=None): if result is None: result = self.defaultTestResult() try: super(SimpleTest, self).run(result) except KeyboardInterrupt: result.stop()