From 1a419c01172ef00b29bc0bbfc39766d9ecccfa18 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 20 Feb 2020 16:11:17 +0000 Subject: new migrationjs and generate_people command working --- ctrack/organisations/tests/factories.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ctrack/organisations/tests/factories.py') diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py index 99a4bb3..e079271 100644 --- a/ctrack/organisations/tests/factories.py +++ b/ctrack/organisations/tests/factories.py @@ -36,7 +36,8 @@ class UserFactory(DjangoModelFactory): class Meta: model = User - name = Faker("name", locale="en_GB") + username = Faker("lexify", text="???????", letters="abcdsgTGQA") + password = Faker("lexify", text="????????", letters="AdOIqkcvBnMP") class ModeFactory(DjangoModelFactory): @@ -86,24 +87,23 @@ class PersonFactory(DjangoModelFactory): if not create: return if extracted: - for role in extracted: - self.role.add(role) + self.role.add(extracted) primary_nis_contact = True voluntary_point_of_contact = True has_egress = False - title = Faker("prefix") + title = factory.LazyFunction(lambda: random.randint(1, 8)) job_title = Faker("job") first_name = Faker("first_name") last_name = Faker("last_name") - organisation = SubFactory(OrganisationFactory) + organisation = SubFactory("ctrack.organisations.tests.factories.OrganisationFactory") email = Faker("ascii_company_email") secondary_email = "ascii_company_email" mobile = Faker("msisdn", locale="en_GB") landline = Faker("phone_number", locale="en_GB") date_updated = factory.LazyFunction(datetime.now) updated_by = SubFactory(UserFactory) - clearance = factory.LazyFunction(datetime.now) + clearance = factory.LazyFunction(lambda: random.randint(1,6)) clearance_sponsor = Faker("name", locale="en_GB") clearance_start_date = factory.LazyFunction(datetime.now) clearance_last_checked = factory.LazyFunction(datetime.now) -- cgit v1.2.3