コード例 #1
0
 def test_context_can_be_updated_and_another_field_updated_globally(self):
     cased.Context.update({"username": "******"})
     assert Context.current() == {"username": "******"}
     cased.Context.update({"action": "test.action"})
     assert Context.current() == {
         "username": "******",
         "action": "test.action"
     }
コード例 #2
0
 def test_context_can_be_cleared_and_then_updated(self):
     Context.update({"username": "******"})
     assert Context.current() == {"username": "******"}
     Context.clear()
     assert Context.current() == {}
     Context.update({"username": "******"})
     assert Context.current() == {"username": "******"}
コード例 #3
0
 def test_context_can_be_updated_twice_globally(self):
     cased.Context.update({"username": "******"})
     assert Context.current() == {"username": "******"}
     cased.Context.update({"username": "******"})
     assert Context.current() == {"username": "******"}
コード例 #4
0
 def test_context_can_be_updated_twice(self):
     Context.update({"username": "******"})
     assert Context.current() == {"username": "******"}
     Context.update({"username": "******"})
     assert Context.current() == {"username": "******"}
コード例 #5
0
 def test_context_current_returns_empty_dict(self):
     assert Context.current() == {}
コード例 #6
0
 def teardown_method(self, method):
     # Clear the context after each test
     Context.clear()