Last change
on this file since 6801 was
6546,
checked in by uli, 13 years ago
|
Add tests for accesscode workflows. Right now we check only those
parts that are needed to reach a testcoverage for the workflow module
of 100%.
|
File size:
1.0 KB
|
Line | |
---|
1 | import shutil |
---|
2 | import tempfile |
---|
3 | from waeup.sirp.testing import FunctionalLayer, FunctionalTestCase |
---|
4 | from waeup.sirp.accesscodes.workflow import ( |
---|
5 | invalidate_action, disable_used_action, disable_unused_action, |
---|
6 | reenable_action, |
---|
7 | ) |
---|
8 | |
---|
9 | class WorkflowActionsTests(FunctionalTestCase): |
---|
10 | # Tests for helpers like get_access_code, disable_accesscode, ... |
---|
11 | |
---|
12 | layer = FunctionalLayer |
---|
13 | |
---|
14 | def setUp(self): |
---|
15 | super(WorkflowActionsTests, self).setUp() |
---|
16 | self.workdir = tempfile.mkdtemp() |
---|
17 | |
---|
18 | def tearDown(self): |
---|
19 | shutil.rmtree(self.workdir) |
---|
20 | super(WorkflowActionsTests, self).tearDown() |
---|
21 | return |
---|
22 | |
---|
23 | def test_actions_wo_parents(self): |
---|
24 | # We can pass contexts without parent to actions |
---|
25 | context = object() # Some fake context without parent |
---|
26 | self.assertTrue(invalidate_action(None, context) is None) |
---|
27 | self.assertTrue(disable_used_action(None, context) is None) |
---|
28 | self.assertTrue(disable_unused_action(None, context) is None) |
---|
29 | self.assertTrue(reenable_action(None, context) is None) |
---|
30 | return |
---|
Note: See
TracBrowser for help on using the repository browser.