def test_membership_number_custom(self): new_member = Member(name="Member two", email="*****@*****.**") new_member.number = "Orange squash" new_member.save() new_member = Member.objects.get(id=new_member.pk) self.assertEqual(new_member.number, "Orange squash")
def test_membership_number_exists_twice(self): old_member = Member.objects.get(id=1) old_member.number = "3" old_member.save() new_member_one = Member(name="Member two", email="*****@*****.**") new_member_one.save() new_member_one.number = "100003" new_member_one.save() new_member_two = Member(name="Member two", email="*****@*****.**") new_member_two.save() self.assertEqual("200003", new_member_two.number)