Questions tagged [pytest-factoryboy]

3 questions
3
votes
2 answers

use factoryboy for django User with Pytest

I am migrating the UnitTests of a Django app to py.test, but in the UnitTests they make use of factory-boy to create instances of django.contrib.auth.models.User. how can this be done with pytest-factory-boy?
switch87
  • 295
  • 1
  • 18
0
votes
1 answer

Pytest cannot test multiple cases with @pytest.mark.parametrize

I defined UserFactory class in tests/factories.py as shown below following the doc. *I use pytest-django and pytest-factoryboy in Django: # "tests/factories.py" import factory from django.contrib.auth.models import User class…
0
votes
1 answer

No build() and create() vs build() vs create() in Factory Boy

I created UserFactory class in factories.py as shown below. I use pytest-django and pytest-factoryboy in Django: # "factories.py" import factory from django.contrib.auth.models import User class UserFactory(factory.django.DjangoModelFactory): …