def test_without_context_user_is_None(self): api = ExposedAPI() self.assertIs(api.user, None)
def test_user_returns_context_user(self): user = MockUser(True, True) context = CallContext(user, None, None) api = ExposedAPI(context) self.assertIs(api.user, context.user)
def test_context_defaults_to_None(self): api = ExposedAPI() self.assertIs(api._context, None)