def test_to_dict_returns_correct_values(self): # when user = User('*****@*****.**', '12345') # then self.assertEqual( { 'email': '*****@*****.**', 'hashed_password': '******', 'is_admin': False, 'id': None, 'tasks': [] }, user.to_dict())
def test_to_dict_all_fields_returns_correct_values(self): # when user = User('*****@*****.**', '12345') # then self.assertEqual( { 'email': '*****@*****.**', 'hashed_password': '******', 'is_admin': False, 'id': None, 'tasks': [] }, user.to_dict({ user.FIELD_ID, user.FIELD_EMAIL, user.FIELD_HASHED_PASSWORD, user.FIELD_IS_ADMIN, user.FIELD_TASKS }))
def test_to_dict_field_id_returns_id(self): # when user = User('*****@*****.**', '12345') # then self.assertEqual({'id': None}, user.to_dict({user.FIELD_ID}))
def test_to_dict_field_tasks_returns_tasks(self): # when user = User('*****@*****.**', '12345') # then self.assertEqual({'tasks': []}, user.to_dict({user.FIELD_TASKS}))
def test_to_dict_field_is_admin_returns_is_admin(self): # when user = User('*****@*****.**', '12345') # then self.assertEqual({'is_admin': False}, user.to_dict({user.FIELD_IS_ADMIN}))
def test_to_dict_field_hashed_password_returns_hashed_password(self): # when user = User('*****@*****.**', '12345') # then self.assertEqual({'hashed_password': '******'}, user.to_dict({user.FIELD_HASHED_PASSWORD}))
def test_to_dict_field_email_returns_email(self): # when user = User('*****@*****.**', '12345') # then self.assertEqual({'email': '*****@*****.**'}, user.to_dict({user.FIELD_EMAIL}))