[Answered ]-Factory Boy populating Local DB instead of Test DB

1👍

For those seeing this issue in the future, this was the problem:

class SignUpTokenFactory(factory.django.DjangoModelFactory):
    class Meta:
        model = SignUpToken

    token = fake.random_number()
    user = UserFactory()

There was another factory elsewhere creating and assigning an instance of the User class. This should’ve been user = Subfactory(UserFactory)

Leave a comment