Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added factory file to apps
  • Loading branch information
Nehemiah60 committed Feb 9, 2023
commit b1d54c0429b3678e5ca508bca2bae09aaaff8ca4
2 changes: 1 addition & 1 deletion project/accounts/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Meta:
first_name = factory.Faker("lorem")
last_name = factory.Faker("lorem")
about_me = factory.Faker("lorem")
is_verified = factory.fuzzy.FuzzyChoice(choices=[False, False, False, False])
is_verified = factory.fuzzy.FuzzyChoice(choices=[False, False])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also allow True?

Suggested change
is_verified = factory.fuzzy.FuzzyChoice(choices=[False, False])
is_verified = factory.fuzzy.FuzzyChoice(choices=[True, False])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not so sure. Because the field had False as a default value. But I will make the changes @brylie

profile_image = factory.Faker("image_url")
profile_image_thumb = factory.Faker("image_url")

Expand Down
4 changes: 0 additions & 4 deletions project/threads/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ def facts(self, create, extracted, **kwargs):
for fact in extracted:
self.facts.add(fact)

@factory.post_generation
def tags(self, create, extracted, **kwargs):
if not create:
return
if extracted:
for tag in extracted:
self.tags.add(tag)

@factory.post_generation
def objects(self, create, extracted, **kwargs):
if not create:
return
Expand Down Expand Up @@ -75,15 +73,13 @@ def linked_civis(self, create, extracted, **kwargs):
for linked_civi in extracted:
self.linked_civis.add(linked_civi)

@factory.post_generation
def tags(self, create, extracted, **kwargs):
if not create:
return
if extracted:
for tag in extracted:
self.tags.add(tag)

@factory.post_generation
def objects(self, create, extracted, **kwargs):
if not create:
return
Expand Down