mirror of
https://github.com/viewflow/viewflow.git
synced 2026-03-13 10:32:34 +08:00
18 lines
709 B
Python
18 lines
709 B
Python
from django.test import TestCase
|
|
from viewflow.workflow.context import context, Context
|
|
|
|
|
|
class Test(TestCase):
|
|
def test_activation_context_scope(self):
|
|
with Context(first_scope='first_scope'):
|
|
with Context(second_scope='second_scope'):
|
|
self.assertEqual(context.first_scope, 'first_scope')
|
|
self.assertEqual(context.second_scope, 'second_scope')
|
|
|
|
self.assertEqual(context.first_scope, 'first_scope')
|
|
self.assertTrue(hasattr(context, 'first_scope'))
|
|
self.assertFalse(hasattr(context, 'second_scope'))
|
|
|
|
self.assertFalse(hasattr(context, 'first_scope'))
|
|
self.assertFalse(hasattr(context, 'second_scope'))
|