Skip to content
This repository has been archived by the owner on Aug 27, 2019. It is now read-only.

Commit

Permalink
consolidate userfactory in acquisitions app
Browse files Browse the repository at this point in the history
  • Loading branch information
stvnrlly committed Nov 30, 2016
1 parent af18f71 commit 0ee80d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 39 deletions.
15 changes: 1 addition & 14 deletions news/factories.py
@@ -1,23 +1,10 @@
import factory
from datetime import datetime, timedelta, tzinfo
from dateutil.tz import tzlocal
from django.contrib.auth.models import User
from acquisitions.factories import UserFactory
from news.models import Post


class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User

username = factory.Faker('user_name')
email = factory.Faker('safe_email')
first_name = factory.Faker('first_name')
last_name = factory.Faker('last_name')
is_active = True
is_staff = False
is_superuser = False


class NewsFactory(factory.django.DjangoModelFactory):
class Meta:
model = Post
Expand Down
13 changes: 1 addition & 12 deletions projects/factories.py
Expand Up @@ -2,22 +2,11 @@
import string
import factory.fuzzy
import random
from acquisitions.factories import UserFactory
from projects.models import IAA, Project, Buy, ContractingOffice, \
ContractingSpecialist, ContractingOfficer, \
ContractingOfficerRepresentative, Agency, \
AgencyOffice
from django.contrib.auth.models import User


class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User

username = factory.Faker('user_name')
email = factory.Faker('safe_email')
is_active = True
is_staff = False
is_superuser = False


class AgencyFactory(factory.django.DjangoModelFactory):
Expand Down
14 changes: 1 addition & 13 deletions team/factories.py
@@ -1,18 +1,6 @@
import factory
from team.models import Teammate, Role
from django.contrib.auth.models import User
from django.contrib.auth.hashers import make_password


class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User

username = factory.Faker('user_name')
email = factory.Faker('safe_email')
is_active = True
is_staff = False
is_superuser = False
from acquisitions.factories import UserFactory


class RoleFactory(factory.django.DjangoModelFactory):
Expand Down

0 comments on commit 0ee80d7

Please sign in to comment.