I’ve been thinking about changing my simple model creation test from this.
def test_create_user(self): user = User.objects.create_user( email@example.com', password='foo', # other fields ) assert user.email == 'firstname.lastname@example.org' # assert other fields
def test_create_user(self): user = UserFactory.create() assert isinstance(user, User)
I’m not sure if they represent the same thing, but I think the second one is easier to read.
I would like to know suggesting about this kind of test, since I’m pretty new to testing thing.
Thanks for your attention.