コード例 #1
0
ファイル: test_members.py プロジェクト: psimonkey/cubetoolkit
    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")
コード例 #2
0
ファイル: test_members.py プロジェクト: BenMotz/cubetoolkit
    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")
コード例 #3
0
ファイル: test_members.py プロジェクト: psimonkey/cubetoolkit
    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)
コード例 #4
0
ファイル: test_members.py プロジェクト: BenMotz/cubetoolkit
    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)