diff --git a/chartofaccountDIT/test/factories.py b/chartofaccountDIT/test/factories.py index b84eacb6..c5ef334e 100644 --- a/chartofaccountDIT/test/factories.py +++ b/chartofaccountDIT/test/factories.py @@ -1,4 +1,4 @@ -from factory.django import DjangoModelFactory +import factory from chartofaccountDIT.models import ( Analysis1, @@ -26,7 +26,7 @@ ) -class Analysis1Factory(DjangoModelFactory): +class Analysis1Factory(factory.django.DjangoModelFactory): """ Define Analysis1 Factory """ @@ -37,12 +37,12 @@ class Meta: active = True -class HistoricalAnalysis1Factory(DjangoModelFactory): +class HistoricalAnalysis1Factory(factory.django.DjangoModelFactory): class Meta: model = ArchivedAnalysis1 -class Analysis2Factory(DjangoModelFactory): +class Analysis2Factory(factory.django.DjangoModelFactory): """ Define Analysis2 Factory """ @@ -53,12 +53,12 @@ class Meta: active = True -class HistoricalAnalysis2Factory(DjangoModelFactory): +class HistoricalAnalysis2Factory(factory.django.DjangoModelFactory): class Meta: model = ArchivedAnalysis2 -class NACCategoryFactory(DjangoModelFactory): +class NACCategoryFactory(factory.django.DjangoModelFactory): """ Define NACCategory Factory """ @@ -69,7 +69,7 @@ class Meta: NAC_category_description = factory.Faker("name") -class OperatingDeliveryCategoryFactory(DjangoModelFactory): +class OperatingDeliveryCategoryFactory(factory.django.DjangoModelFactory): """ Define OperatingDeliveryCategory Factory """ @@ -78,7 +78,7 @@ class Meta: model = OperatingDeliveryCategory -class ExpenditureCategoryFactory(DjangoModelFactory): +class ExpenditureCategoryFactory(factory.django.DjangoModelFactory): """ Define ExpenditureCategory Factory """ @@ -90,14 +90,14 @@ class Meta: model = ExpenditureCategory -class HistoricalExpenditureCategoryFactory(DjangoModelFactory): +class HistoricalExpenditureCategoryFactory(factory.django.DjangoModelFactory): grouping_description = "Test Archived Budget Category" class Meta: model = ArchivedExpenditureCategory -class CommercialCategoryFactory(DjangoModelFactory): +class CommercialCategoryFactory(factory.django.DjangoModelFactory): """ Define CommercialCategory Factory """ @@ -108,14 +108,14 @@ class Meta: model = CommercialCategory -class HistoricalCommercialCategoryFactory(DjangoModelFactory): +class HistoricalCommercialCategoryFactory(factory.django.DjangoModelFactory): active = True class Meta: model = ArchivedCommercialCategory -class NaturalCodeFactory(DjangoModelFactory): +class NaturalCodeFactory(factory.django.DjangoModelFactory): """ Define NaturalCode Factory """ @@ -130,7 +130,7 @@ class Meta: used_for_budget = False -class HistoricalNaturalCodeFactory(DjangoModelFactory): +class HistoricalNaturalCodeFactory(factory.django.DjangoModelFactory): active = True natural_account_code = 87654321 @@ -141,7 +141,7 @@ class Meta: model = ArchivedNaturalCode -class ProgrammeCodeFactory(DjangoModelFactory): +class ProgrammeCodeFactory(factory.django.DjangoModelFactory): """ Define ProgrammeCode Factory """ @@ -156,7 +156,7 @@ class Meta: budget_type = factory.Iterator(BudgetType.objects.all()) -class HistoricalProgrammeCodeFactory(DjangoModelFactory): +class HistoricalProgrammeCodeFactory(factory.django.DjangoModelFactory): """ Define ArchivedProgrammeCode Factory """ @@ -170,7 +170,7 @@ class Meta: model = ArchivedProgrammeCode -class InterEntityL1Factory(DjangoModelFactory): +class InterEntityL1Factory(factory.django.DjangoModelFactory): """ Define InterEntityL1 Factory """ @@ -179,7 +179,7 @@ class Meta: model = InterEntityL1 -class InterEntityFactory(DjangoModelFactory): +class InterEntityFactory(factory.django.DjangoModelFactory): """ Define InterEntity Factory """ @@ -191,14 +191,14 @@ class Meta: model = InterEntity -class HistoricalInterEntityFactory(DjangoModelFactory): +class HistoricalInterEntityFactory(factory.django.DjangoModelFactory): active = True class Meta: model = ArchivedInterEntity -class ProjectCodeFactory(DjangoModelFactory): +class ProjectCodeFactory(factory.django.DjangoModelFactory): """ Define ProjectCode Factory """ @@ -212,7 +212,7 @@ class Meta: project_description = "Project Description" -class HistoricalProjectCodeFactory(DjangoModelFactory): +class HistoricalProjectCodeFactory(factory.django.DjangoModelFactory): """ Define ArchivedProjectCode Factory """ @@ -225,7 +225,7 @@ class Meta: model = ArchivedProjectCode -class FCOMappingFactory(DjangoModelFactory): +class FCOMappingFactory(factory.django.DjangoModelFactory): """ Define FCOMapping Factory """ @@ -238,7 +238,7 @@ class Meta: model = FCOMapping -class HistoricalFCOMappingFactory(DjangoModelFactory): +class HistoricalFCOMappingFactory(factory.django.DjangoModelFactory): """ Define ArchivedFCOMapping Factory """ diff --git a/core/test/factories.py b/core/test/factories.py index 056638cd..e63b83ee 100644 --- a/core/test/factories.py +++ b/core/test/factories.py @@ -1,4 +1,5 @@ -from factory.django import DjangoModelFactory +import factory +import factory from django.contrib.auth import get_user_model from faker import Faker diff --git a/costcentre/test/factories.py b/costcentre/test/factories.py index 3bf43ff1..d7297e42 100644 --- a/costcentre/test/factories.py +++ b/costcentre/test/factories.py @@ -1,4 +1,4 @@ -from factory.django import DjangoModelFactory +import factory from faker import Faker from core.models import FinancialYear @@ -15,7 +15,7 @@ fake = Faker() -class DepartmentalGroupFactory(DjangoModelFactory): +class DepartmentalGroupFactory(factory.django.DjangoModelFactory): """ Define DepartmentalGroup Factory """ @@ -30,7 +30,7 @@ class Meta: active = True -class DirectorateFactory(DjangoModelFactory): +class DirectorateFactory(factory.django.DjangoModelFactory): class Meta: model = Directorate django_get_or_create = ("directorate_code",) @@ -41,7 +41,7 @@ class Meta: active = True -class FinancialYearFactory(DjangoModelFactory): +class FinancialYearFactory(factory.django.DjangoModelFactory): class Meta: model = FinancialYear django_get_or_create = ("financial_year",) @@ -49,7 +49,7 @@ class Meta: financial_year = 2019 -class FinanceBusinessPartnerFactory(DjangoModelFactory): +class FinanceBusinessPartnerFactory(factory.django.DjangoModelFactory): class Meta: model = BusinessPartner django_get_or_create = ("name", "surname") @@ -58,7 +58,7 @@ class Meta: surname = "FBP" -class BSCEFactory(DjangoModelFactory): +class BSCEFactory(factory.django.DjangoModelFactory): class Meta: model = BSCEEmail django_get_or_create = ("bsce_email",) @@ -66,7 +66,7 @@ class Meta: bsce_email = "bsceuser@test.com" # /PS-IGNORE -class CostCentreFactory(DjangoModelFactory): +class CostCentreFactory(factory.django.DjangoModelFactory): """ Define CostCentre Factory """ @@ -83,7 +83,7 @@ class Meta: bsce_email = factory.SubFactory(BSCEFactory) -class ArchivedCostCentreFactory(DjangoModelFactory): +class ArchivedCostCentreFactory(factory.django.DjangoModelFactory): class Meta: model = ArchivedCostCentre diff --git a/download_file/test/factories.py b/download_file/test/factories.py index 06874297..7115220a 100644 --- a/download_file/test/factories.py +++ b/download_file/test/factories.py @@ -1,8 +1,8 @@ -from factory.django import DjangoModelFactory +import factory from upload_file.models import FileUpload -class FileUploadFactory(DjangoModelFactory): +class FileUploadFactory(factory.django.DjangoModelFactory): class Meta: model = FileUpload diff --git a/forecast/test/factories.py b/forecast/test/factories.py index 6314f719..8e0af577 100644 --- a/forecast/test/factories.py +++ b/forecast/test/factories.py @@ -1,4 +1,4 @@ -from factory.django import DjangoModelFactory +import factory from chartofaccountDIT.test.factories import NaturalCodeFactory, ProgrammeCodeFactory from core.models import FinancialYear @@ -14,7 +14,7 @@ ) -class FinancialPeriodFactory(DjangoModelFactory): +class FinancialPeriodFactory(factory.django.DjangoModelFactory): class Meta: model = FinancialPeriod @@ -24,7 +24,7 @@ class Meta: period_calendar_code = 4 -class FinancialCodeFactory(DjangoModelFactory): +class FinancialCodeFactory(factory.django.DjangoModelFactory): programme = factory.SubFactory(ProgrammeCodeFactory) cost_centre = factory.SubFactory(CostCentreFactory) natural_account_code = factory.SubFactory(NaturalCodeFactory) @@ -33,18 +33,18 @@ class Meta: model = FinancialCode -class BudgetMonthlyFigureFactory(DjangoModelFactory): +class BudgetMonthlyFigureFactory(factory.django.DjangoModelFactory): financial_code = factory.SubFactory(FinancialCodeFactory) financial_year = factory.Iterator(FinancialYear.objects.all()) financial_period = factory.Iterator(FinancialPeriod.objects.all()) -class BudgetFactory(DjangoModelFactory): +class BudgetFactory(factory.django.DjangoModelFactory): class Meta: model = BudgetMonthlyFigure -class FinancialCodeFactory(DjangoModelFactory): +class FinancialCodeFactory(factory.django.DjangoModelFactory): programme = factory.SubFactory(ProgrammeCodeFactory) cost_centre = factory.SubFactory(CostCentreFactory) natural_account_code = factory.SubFactory(NaturalCodeFactory) @@ -53,7 +53,7 @@ class Meta: model = FinancialCode -class MonthlyFigureFactory(DjangoModelFactory): +class MonthlyFigureFactory(factory.django.DjangoModelFactory): financial_year = factory.Iterator(FinancialYear.objects.all()) financial_period = factory.Iterator(FinancialPeriod.objects.all()) financial_code = factory.SubFactory(FinancialCodeFactory) @@ -63,16 +63,16 @@ class Meta: model = ForecastMonthlyFigure -class ForecastEditStateFactory(DjangoModelFactory): +class ForecastEditStateFactory(factory.django.DjangoModelFactory): class Meta: model = ForecastEditState -class FutureForecastEditStateFactory(DjangoModelFactory): +class FutureForecastEditStateFactory(factory.django.DjangoModelFactory): class Meta: model = FutureForecastEditState -class UnlockedForecastEditorFactory(DjangoModelFactory): +class UnlockedForecastEditorFactory(factory.django.DjangoModelFactory): class Meta: model = UnlockedForecastEditor diff --git a/gifthospitality/test/factories.py b/gifthospitality/test/factories.py index aa1151c8..c4304663 100644 --- a/gifthospitality/test/factories.py +++ b/gifthospitality/test/factories.py @@ -1,4 +1,4 @@ -from factory.django import DjangoModelFactory +import factory from gifthospitality.models import ( GiftAndHospitality, @@ -8,7 +8,7 @@ ) -class GiftsAndHospitalityFactory(DjangoModelFactory): +class GiftsAndHospitalityFactory(factory.django.DjangoModelFactory): """ Define GiftsAndHospitality Factory """ @@ -17,7 +17,7 @@ class Meta: model = GiftAndHospitality -class GiftsAndHospitalityCategoryFactory(DjangoModelFactory): +class GiftsAndHospitalityCategoryFactory(factory.django.DjangoModelFactory): """ Define GiftsAndHospitalityCategory Factory """ @@ -26,7 +26,7 @@ class Meta: model = GiftAndHospitalityCategory -class GiftsAndHospitalityClassificationFactory(DjangoModelFactory): +class GiftsAndHospitalityClassificationFactory(factory.django.DjangoModelFactory): """ Define CostCentre Factory """ @@ -35,7 +35,7 @@ class Meta: model = GiftAndHospitalityClassification -class GiftsAndHospitalityCompanyFactory(DjangoModelFactory): +class GiftsAndHospitalityCompanyFactory(factory.django.DjangoModelFactory): """ Define CostCentre Factory """ diff --git a/treasuryCOA/test/factories.py b/treasuryCOA/test/factories.py index 69c3986b..c73bcc46 100644 --- a/treasuryCOA/test/factories.py +++ b/treasuryCOA/test/factories.py @@ -1,4 +1,4 @@ -from factory.django import DjangoModelFactory +import factory from treasuryCOA.models import ( HistoricL5Account, @@ -10,7 +10,7 @@ ) -class L1AccountFactory(DjangoModelFactory): +class L1AccountFactory(factory.django.DjangoModelFactory): """ Define L1Account Factory """ @@ -21,7 +21,7 @@ class Meta: account_l1_code = 1111111 -class L2AccountFactory(DjangoModelFactory): +class L2AccountFactory(factory.django.DjangoModelFactory): """ Define L2Account Factory """ @@ -33,7 +33,7 @@ class Meta: account_l1 = factory.SubFactory(L1AccountFactory) -class L3AccountFactory(DjangoModelFactory): +class L3AccountFactory(factory.django.DjangoModelFactory): """ Define L3Account Factory """ @@ -45,7 +45,7 @@ class Meta: account_l2 = factory.SubFactory(L2AccountFactory) -class L4AccountFactory(DjangoModelFactory): +class L4AccountFactory(factory.django.DjangoModelFactory): """ Define L4Account Factory """ @@ -57,7 +57,7 @@ class Meta: account_l3 = factory.SubFactory(L3AccountFactory) -class L5AccountFactory(DjangoModelFactory): +class L5AccountFactory(factory.django.DjangoModelFactory): """ Define L5Account Factory """ @@ -70,7 +70,7 @@ class Meta: account_l4 = factory.SubFactory(L4AccountFactory) -class HistoricL5AccountFactory(DjangoModelFactory): +class HistoricL5AccountFactory(factory.django.DjangoModelFactory): """ Define HistoricL5Account Factory """ diff --git a/treasurySS/test/factories.py b/treasurySS/test/factories.py index 172b267a..f6467ed0 100644 --- a/treasurySS/test/factories.py +++ b/treasurySS/test/factories.py @@ -1,4 +1,4 @@ -from factory.django import DjangoModelFactory +import factory from chartofaccountDIT.models import BudgetType from treasurySS.models import ( @@ -10,7 +10,7 @@ ) -class SegmentGrandParentFactory(DjangoModelFactory): +class SegmentGrandParentFactory(factory.django.DjangoModelFactory): """ Define SegmentGrandParent Factory """ @@ -20,7 +20,7 @@ class Meta: django_get_or_create = ("segment_grand_parent_code",) -class SegmentParentFactory(DjangoModelFactory): +class SegmentParentFactory(factory.django.DjangoModelFactory): """ Define SegmentParent Factory """ @@ -32,7 +32,7 @@ class Meta: django_get_or_create = ("segment_parent_code",) -class SegmentFactory(DjangoModelFactory): +class SegmentFactory(factory.django.DjangoModelFactory): """ Define Segment Factory """ @@ -44,7 +44,7 @@ class Meta: django_get_or_create = ("segment_code",) -class EstimateRowFactory(DjangoModelFactory): +class EstimateRowFactory(factory.django.DjangoModelFactory): """ Define EstimateRow Factory """ @@ -53,7 +53,7 @@ class Meta: model = EstimateRow -class SubSegmentFactory(DjangoModelFactory): +class SubSegmentFactory(factory.django.DjangoModelFactory): """ Define SubSegment Factory """ diff --git a/upload_file/test/factories.py b/upload_file/test/factories.py index 06874297..7115220a 100644 --- a/upload_file/test/factories.py +++ b/upload_file/test/factories.py @@ -1,8 +1,8 @@ -from factory.django import DjangoModelFactory +import factory from upload_file.models import FileUpload -class FileUploadFactory(DjangoModelFactory): +class FileUploadFactory(factory.django.DjangoModelFactory): class Meta: model = FileUpload