OpenEventTestCase
contains no test methods23 Setup.drop_db()
24
25
26class OpenEventTestCase(unittest.TestCase):27 """Sets up and tears down database once per class and
28 uses nested transaction rollback for each test"""
29
OpenEventLegacyTestCase
contains no test methods12 return user
13
14
15class OpenEventLegacyTestCase(unittest.TestCase):16 """Sets up and tears down database on each run of tests
17 Only use for those tests where OpenEventTestCase does not work"""
18
Test methods should always start with the test
. If there are no such methods,
the class overriding unittest.TestCase
won't run any test.
Not preferred:
import unittest
def Tests(unittest.TestCase):
def my_test(self, arg1, arg2):
self.assertEquals(arg1, arg2)
Preferred:
import unittest
def Tests(unittest.TestCase):
def test_something(self, arg1, arg2):
self.assertEquals(arg1, arg2)