示例#1
0
文件: tests.py 项目: BoichukN/Library
 def test_create(self):
     author = Author.create(name="testName", surname="s1", patronymic="p1")
     author = Author.objects.get(id=author.id)
     self.assertIsInstance(author, Author)
     self.assertEqual(author.name, "testName")
     self.assertEqual(author.surname, "s1")
     self.assertEqual(author.patronymic, "p1")
示例#2
0
文件: tests.py 项目: BoichukN/Library
 def test_createnot_valid_surname(self):
     author = Author.create(name="testName",
                            surname="s1" * 20,
                            patronymic="p1")
     self.assertIsNone(author)