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")
def test_createnot_valid_surname(self): author = Author.create(name="testName", surname="s1" * 20, patronymic="p1") self.assertIsNone(author)