def test_get_data_from_exists_user(self): data = UserFactory.create() u = user.get(data.username) expect(u.username).to_equal(data.username) expect(u.email).to_equal(data.email)
def test_get_user_not_found(self): u = user.get("not_a_exist_user") expect(u).to_be_null()
def get_current_username(self): user = self.get_current_user() if user is None: return "" return user.get("name", "")