Files
viewflow/tests/workflow/test_context.py
Mikhail Podgurskiy bb1f50fa21 V2 dump
2022-10-14 17:59:53 +06:00

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'))