From 63b1457f342972db4a3066b134261a1bc9ed317f Mon Sep 17 00:00:00 2001
From: Fredrik Jonsson <frjo@xdeb.org>
Date: Wed, 25 Aug 2021 13:27:48 +0200
Subject: [PATCH] The factory.DjangoModelFactory is now
 factory.django.DjangoModelFactory.

---
 hypha/apply/activity/tests/factories.py       |  6 ++---
 hypha/apply/categories/tests/factories.py     |  4 ++--
 hypha/apply/determinations/tests/factories.py |  4 ++--
 hypha/apply/funds/tests/factories/models.py   | 18 +++++++-------
 hypha/apply/projects/tests/factories.py       | 24 +++++++++----------
 hypha/apply/review/tests/factories/models.py  |  6 ++---
 hypha/apply/users/tests/factories.py          |  4 ++--
 7 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/hypha/apply/activity/tests/factories.py b/hypha/apply/activity/tests/factories.py
index c1328192d..7c38aea71 100644
--- a/hypha/apply/activity/tests/factories.py
+++ b/hypha/apply/activity/tests/factories.py
@@ -15,7 +15,7 @@ from hypha.apply.funds.tests.factories import ApplicationSubmissionFactory
 from hypha.apply.users.tests.factories import UserFactory
 
 
-class ActivityFactory(factory.DjangoModelFactory):
+class ActivityFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Activity
 
@@ -35,7 +35,7 @@ class CommentFactory(ActivityFactory):
         return model_class.comments
 
 
-class EventFactory(factory.DjangoModelFactory):
+class EventFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Event
 
@@ -44,7 +44,7 @@ class EventFactory(factory.DjangoModelFactory):
     source = factory.SubFactory(ApplicationSubmissionFactory)
 
 
-class MessageFactory(factory.DjangoModelFactory):
+class MessageFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Message
 
diff --git a/hypha/apply/categories/tests/factories.py b/hypha/apply/categories/tests/factories.py
index b311c2c6d..d63bc904a 100644
--- a/hypha/apply/categories/tests/factories.py
+++ b/hypha/apply/categories/tests/factories.py
@@ -3,7 +3,7 @@ import factory
 from ..models import Category, Option
 
 
-class CategoryFactory(factory.DjangoModelFactory):
+class CategoryFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Category
 
@@ -11,7 +11,7 @@ class CategoryFactory(factory.DjangoModelFactory):
     help_text = factory.Faker('sentence')
 
 
-class OptionFactory(factory.DjangoModelFactory):
+class OptionFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Option
 
diff --git a/hypha/apply/determinations/tests/factories.py b/hypha/apply/determinations/tests/factories.py
index 2d4d791cf..272e1a46c 100644
--- a/hypha/apply/determinations/tests/factories.py
+++ b/hypha/apply/determinations/tests/factories.py
@@ -34,7 +34,7 @@ class DeterminationDataFactory(factory.DictFactory):
         return super()._build(model_class, *args, **form_fields)
 
 
-class DeterminationFactory(factory.DjangoModelFactory):
+class DeterminationFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Determination
 
@@ -84,7 +84,7 @@ DeterminationFormFieldsFactory = StreamFieldUUIDFactory({
 })
 
 
-class DeterminationFormFactory(factory.DjangoModelFactory):
+class DeterminationFormFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = DeterminationForm
 
diff --git a/hypha/apply/funds/tests/factories/models.py b/hypha/apply/funds/tests/factories/models.py
index 1d89a68eb..59727aa61 100644
--- a/hypha/apply/funds/tests/factories/models.py
+++ b/hypha/apply/funds/tests/factories/models.py
@@ -110,7 +110,7 @@ class RequestForPartnersFactory(AbstractApplicationFactory):
         model = RequestForPartners
 
 
-class AbstractRelatedFormFactory(factory.DjangoModelFactory):
+class AbstractRelatedFormFactory(factory.django.DjangoModelFactory):
     class Meta:
         abstract = True
     form = factory.SubFactory('hypha.apply.funds.tests.factories.ApplicationFormFactory')
@@ -122,7 +122,7 @@ class ApplicationBaseFormFactory(AbstractRelatedFormFactory):
     application = factory.SubFactory(FundTypeFactory)
 
 
-class ApplicationFormFactory(factory.DjangoModelFactory):
+class ApplicationFormFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ApplicationForm
 
@@ -214,7 +214,7 @@ class ApplicationFormDataFactory(FormDataFactory):
     field_factory = blocks.CustomFormFieldsFactory
 
 
-class ApplicationSubmissionFactory(factory.DjangoModelFactory):
+class ApplicationSubmissionFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ApplicationSubmission
 
@@ -258,7 +258,7 @@ class ApplicationSubmissionFactory(factory.DjangoModelFactory):
                 )
 
 
-class ReviewerRoleFactory(factory.DjangoModelFactory):
+class ReviewerRoleFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ReviewerRole
 
@@ -266,7 +266,7 @@ class ReviewerRoleFactory(factory.DjangoModelFactory):
     order = factory.Sequence(lambda n: n)
 
 
-class AssignedReviewersFactory(factory.DjangoModelFactory):
+class AssignedReviewersFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = AssignedReviewers
         django_get_or_create = ('submission', 'reviewer')
@@ -316,7 +316,7 @@ class LabSubmissionFactory(ApplicationSubmissionFactory):
     page = factory.SubFactory(LabFactory)
 
 
-class ApplicationRevisionFactory(factory.DjangoModelFactory):
+class ApplicationRevisionFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ApplicationRevision
 
@@ -329,7 +329,7 @@ class ApplicationRevisionFactory(factory.DjangoModelFactory):
     )
 
 
-class AbstractReviewFormFactory(factory.DjangoModelFactory):
+class AbstractReviewFormFactory(factory.django.DjangoModelFactory):
     class Meta:
         abstract = True
     form = factory.SubFactory('hypha.apply.review.tests.factories.ReviewFormFactory')
@@ -356,7 +356,7 @@ class LabBaseReviewFormFactory(AbstractReviewFormFactory):
     lab = factory.SubFactory(LabFactory)
 
 
-class ScreeningStatusFactory(factory.DjangoModelFactory):
+class ScreeningStatusFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ScreeningStatus
 
@@ -364,7 +364,7 @@ class ScreeningStatusFactory(factory.DjangoModelFactory):
     yes = factory.Iterator([True, False])
 
 
-class ReminderFactory(factory.DjangoModelFactory):
+class ReminderFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Reminder
 
diff --git a/hypha/apply/projects/tests/factories.py b/hypha/apply/projects/tests/factories.py
index 5c8bacdf5..a667e51f4 100644
--- a/hypha/apply/projects/tests/factories.py
+++ b/hypha/apply/projects/tests/factories.py
@@ -50,7 +50,7 @@ def address_to_form_data():
     }
 
 
-class DocumentCategoryFactory(factory.DjangoModelFactory):
+class DocumentCategoryFactory(factory.django.DjangoModelFactory):
     name = factory.Sequence('name {}'.format)
     recommended_minimum = 1
 
@@ -58,7 +58,7 @@ class DocumentCategoryFactory(factory.DjangoModelFactory):
         model = DocumentCategory
 
 
-class ProjectApprovalFormFactory(factory.DjangoModelFactory):
+class ProjectApprovalFormFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ProjectApprovalForm
 
@@ -70,7 +70,7 @@ class ProjectApprovalFormDataFactory(FormDataFactory):
     field_factory = FormFieldsBlockFactory
 
 
-class ProjectFactory(factory.DjangoModelFactory):
+class ProjectFactory(factory.django.DjangoModelFactory):
     submission = factory.SubFactory(ApplicationSubmissionFactory)
     user = factory.SubFactory(UserFactory)
 
@@ -103,7 +103,7 @@ class ProjectFactory(factory.DjangoModelFactory):
         )
 
 
-class ContractFactory(factory.DjangoModelFactory):
+class ContractFactory(factory.django.DjangoModelFactory):
     approver = factory.SubFactory(StaffFactory)
     project = factory.SubFactory(ProjectFactory)
     approved_at = factory.LazyFunction(timezone.now)
@@ -115,7 +115,7 @@ class ContractFactory(factory.DjangoModelFactory):
         model = Contract
 
 
-class PacketFileFactory(factory.DjangoModelFactory):
+class PacketFileFactory(factory.django.DjangoModelFactory):
     category = factory.SubFactory(DocumentCategoryFactory)
     project = factory.SubFactory(ProjectFactory)
 
@@ -126,7 +126,7 @@ class PacketFileFactory(factory.DjangoModelFactory):
         model = PacketFile
 
 
-class PaymentRequestFactory(factory.DjangoModelFactory):
+class PaymentRequestFactory(factory.django.DjangoModelFactory):
     project = factory.SubFactory(ProjectFactory)
     by = factory.SubFactory(UserFactory)
     requested_value = factory.Faker('pydecimal', min_value=1, max_value=10000000, right_digits=2)
@@ -140,7 +140,7 @@ class PaymentRequestFactory(factory.DjangoModelFactory):
         model = PaymentRequest
 
 
-class InvoiceFactory(factory.DjangoModelFactory):
+class InvoiceFactory(factory.django.DjangoModelFactory):
     project = factory.SubFactory(ProjectFactory)
     by = factory.SubFactory(UserFactory)
     amount = factory.Faker('pydecimal', min_value=1, max_value=10000000, right_digits=2)
@@ -154,7 +154,7 @@ class InvoiceFactory(factory.DjangoModelFactory):
         model = Invoice
 
 
-class PaymentReceiptFactory(factory.DjangoModelFactory):
+class PaymentReceiptFactory(factory.django.DjangoModelFactory):
     payment_request = factory.SubFactory(PaymentRequestFactory)
 
     file = factory.django.FileField()
@@ -163,7 +163,7 @@ class PaymentReceiptFactory(factory.DjangoModelFactory):
         model = PaymentReceipt
 
 
-class SupportingDocumentFactory(factory.DjangoModelFactory):
+class SupportingDocumentFactory(factory.django.DjangoModelFactory):
     invoice = factory.SubFactory(InvoiceFactory)
 
     document = factory.django.FileField()
@@ -172,7 +172,7 @@ class SupportingDocumentFactory(factory.DjangoModelFactory):
         model = SupportingDocument
 
 
-class ReportConfigFactory(factory.DjangoModelFactory):
+class ReportConfigFactory(factory.django.DjangoModelFactory):
     project = factory.SubFactory(
         "hypha.apply.projects.tests.factories.ApprovedProjectFactory",
         report_config=None,
@@ -188,7 +188,7 @@ class ReportConfigFactory(factory.DjangoModelFactory):
         )
 
 
-class ReportVersionFactory(factory.DjangoModelFactory):
+class ReportVersionFactory(factory.django.DjangoModelFactory):
     report = factory.SubFactory("hypha.apply.projects.tests.factories.ReportFactory")
     submitted = factory.LazyFunction(timezone.now)
     public_content = factory.Faker('paragraph')
@@ -212,7 +212,7 @@ class ReportVersionFactory(factory.DjangoModelFactory):
             obj.report.save()
 
 
-class ReportFactory(factory.DjangoModelFactory):
+class ReportFactory(factory.django.DjangoModelFactory):
     project = factory.SubFactory("hypha.apply.projects.tests.factories.ApprovedProjectFactory")
     end_date = factory.LazyFunction(timezone.now)
 
diff --git a/hypha/apply/review/tests/factories/models.py b/hypha/apply/review/tests/factories/models.py
index 97c72de35..07bfc59ba 100644
--- a/hypha/apply/review/tests/factories/models.py
+++ b/hypha/apply/review/tests/factories/models.py
@@ -17,7 +17,7 @@ class ReviewFormDataFactory(FormDataFactory):
     field_factory = blocks.ReviewFormFieldsFactory
 
 
-class ReviewFactory(factory.DjangoModelFactory):
+class ReviewFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Review
 
@@ -41,7 +41,7 @@ class ReviewFactory(factory.DjangoModelFactory):
     score = 0
 
 
-class ReviewOpinionFactory(factory.DjangoModelFactory):
+class ReviewOpinionFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ReviewOpinion
 
@@ -54,7 +54,7 @@ class ReviewOpinionFactory(factory.DjangoModelFactory):
     opinion = DISAGREE
 
 
-class ReviewFormFactory(factory.DjangoModelFactory):
+class ReviewFormFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = ReviewForm
 
diff --git a/hypha/apply/users/tests/factories.py b/hypha/apply/users/tests/factories.py
index a564eeb8c..0fd7c721a 100644
--- a/hypha/apply/users/tests/factories.py
+++ b/hypha/apply/users/tests/factories.py
@@ -16,7 +16,7 @@ from ..groups import (
 )
 
 
-class GroupFactory(factory.DjangoModelFactory):
+class GroupFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = Group
         django_get_or_create = ('name',)
@@ -24,7 +24,7 @@ class GroupFactory(factory.DjangoModelFactory):
     name = factory.Sequence('group name {}'.format)
 
 
-class UserFactory(factory.DjangoModelFactory):
+class UserFactory(factory.django.DjangoModelFactory):
     class Meta:
         model = get_user_model()
 
-- 
GitLab