def test_token_is_string(self): clean_data = clean_up_output(user_data) token = clean_data[User.__token_attr__] self.assertIsInstance(token, str)
def test_removes_password(self): clean_data = clean_up_output(user_data) self.assertNotIn(User.__password_attr__, clean_data)
def test_returns_a_dict(self): clean_data = clean_up_output(user_data) self.assertIsNotNone(clean_data) self.assertIsInstance(clean_data, dict)
def test_does_not_change_input_parameter(self): copy = dict(user_data) clean_up_output(copy) self.assertEqual(user_data, copy)
async def all(self, limit=100) -> List[User]: cursor = self.collection.find() users_data = await cursor.to_list(length=limit) return [clean_up_output(u) for u in users_data]