aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/tests/factories.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-02-20 21:21:54 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-02-20 21:21:54 +0000
commit96710f1c270bcbd2516f05720ad8985a8255774f (patch)
tree612706be137481a15ed1e716f3c4101aa534911f /ctrack/organisations/tests/factories.py
parenta60f06d4f365bcc94004e5199a54dbe9791ccadb (diff)
improved populate script now
Diffstat (limited to 'ctrack/organisations/tests/factories.py')
-rw-r--r--ctrack/organisations/tests/factories.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py
index 3bad765..61f2ae3 100644
--- a/ctrack/organisations/tests/factories.py
+++ b/ctrack/organisations/tests/factories.py
@@ -40,28 +40,13 @@ class UserFactory(DjangoModelFactory):
password = Faker("lexify", text="????????", letters="AdOIqkcvBnMP")
-class ModeFactory(DjangoModelFactory):
- class Meta:
- model = Mode
-
- descriptor = factory.LazyFunction(_random_mode)
-
-
-class SubModeFactory(DjangoModelFactory):
- class Meta:
- model = Submode
-
- descriptor = factory.LazyFunction(_random_submode)
- mode = SubFactory(ModeFactory)
-
-
class OrganisationFactory(DjangoModelFactory):
class Meta:
model = Organisation
name = Faker("company")
slug = Faker("lexify", text="????", letters="abcdsg")
- submode = SubFactory(SubModeFactory)
+# submode = SubFactory(SubModeFactory)
designation_type = 1
registered_company_name = Faker("company")
registered_company_number = Faker("numerify", text="######")
@@ -82,6 +67,14 @@ class PersonFactory(DjangoModelFactory):
class Meta:
model = Person
+ # @post_generation
+ # def organisation(self, create, extracted, **kwargs):
+ # if not create:
+ # return
+ # if extracted:
+ # for org in extracted:
+ # self.organisation.add(org)
+
@post_generation
def role(self, create, extracted, **kwargs):
if not create: