2014-12-03 20:36:17 +00:00
|
|
|
from django.test import SimpleTestCase
|
2014-11-12 01:32:44 +00:00
|
|
|
|
2014-12-04 02:21:11 +00:00
|
|
|
from ..utils import setup
|
2014-11-12 01:32:44 +00:00
|
|
|
|
|
|
|
|
2014-12-03 20:36:17 +00:00
|
|
|
class SetupTests(SimpleTestCase):
|
2014-11-12 01:32:44 +00:00
|
|
|
def test_setup(self):
|
|
|
|
"""
|
|
|
|
Let's just make sure setup runs cases in the right order.
|
|
|
|
"""
|
|
|
|
cases = []
|
|
|
|
|
|
|
|
@setup({})
|
|
|
|
def method(self):
|
|
|
|
cases.append(
|
|
|
|
[
|
2014-12-07 08:43:10 +00:00
|
|
|
self.engine.string_if_invalid,
|
|
|
|
self.engine.debug,
|
2014-11-12 01:32:44 +00:00
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
method(self)
|
|
|
|
|
|
|
|
self.assertEqual(cases[0], ["", False])
|
|
|
|
self.assertEqual(cases[1], ["", False])
|
|
|
|
self.assertEqual(cases[2], ["INVALID", False])
|
|
|
|
self.assertEqual(cases[3], ["INVALID", False])
|
|
|
|
self.assertEqual(cases[4], ["", True])
|
|
|
|
self.assertEqual(cases[5], ["", True])
|