MAINT: Refactor, move factories into tests

This commit is contained in:
Matthew Ryan Dillon 2016-08-21 16:06:38 -07:00
parent 31714215d0
commit 02a21306fe
16 changed files with 49 additions and 42 deletions

View file

@ -0,0 +1,11 @@
from factory import DjangoModelFactory, Sequence
from ..models import User
class UserFactory(DjangoModelFactory):
class Meta:
model = User
name = Sequence(lambda n: 'user{}'.format(n))
username = Sequence(lambda n: 'username{}'.format(n))

View file

@ -2,7 +2,7 @@ from django.test import TestCase
from django.db import IntegrityError, transaction
from ..models import User
from ..factories import UserFactory
from .factories import UserFactory
class UserTestCase(TestCase):