def test_make_multi_large(self): """ UserFactory can generate 1000 users For all generated users, assert that they are valid after creation """ UserFactory.create_batch(1000) # act self.assertEqual(self.user_model.objects.count(), 1000) for user in self.user_model.objects.all(): user.full_clean()
def test_make_multi(self): """ UserFactory can create two Users with default settings using batch Only username is unique between instances. """ UserFactory.create_batch(2) # act self.assertEqual(self.user_model.objects.count(), 2) user_first = self.user_model.objects.first() user_last = self.user_model.objects.last() self.assertNotEqual(user_first.username, user_last.username)