def test_user_can_be_loaded_from_api_key(self): alice = self.make_participant('alice') api_key = alice.recreate_api_key() actual = User.from_api_key(api_key).username assert actual == 'alice', actual
def test_user_from_None_api_key_is_anonymous(self): self.make_participant('alice') self.make_participant('bob') user = User.from_api_key(None) assert user.ANON
def test_user_from_bad_api_key_is_anonymous(self): user = User.from_api_key('deadbeef') assert user.ANON