def test_change_address(self): self.test_add_profile() self.assertTrue(self.db.change_address_road(self.new_prof.email, "new road")) profile_data = self.db.get_profile_data(self.new_prof.email) self.assertNotEqual(Profile.get_profile(profile_data).address, self.new_prof.address["road"])
def test_change_phone(self): self.test_add_profile() self.assertTrue(self.db.change_phone(self.new_prof.email, 1112233444)) profile_data = self.db.get_profile_data(self.new_prof.email) self.assertNotEqual(Profile.get_profile(profile_data).phone, self.new_prof.phone)
def test_add_profile(self): self.assertTrue(self.db.add_profile(self.new_prof)) profile_data = self.db.get_profile_data(self.new_prof.email) self.assertNotEqual(profile_data, None) self.assertEqual(Profile.get_profile(profile_data).email, self.new_prof.email) #Try add another with same email, should fail self.assertFalse(self.db.add_profile(self.new_prof))