Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
SamDudley committed Mar 28, 2024
1 parent 986fd8f commit 6b98b44
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 63 deletions.
44 changes: 22 additions & 22 deletions chartofaccountDIT/test/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from factory.django import DjangoModelFactory
import factory

from chartofaccountDIT.models import (
Analysis1,
Expand Down Expand Up @@ -26,7 +26,7 @@
)


class Analysis1Factory(DjangoModelFactory):
class Analysis1Factory(factory.django.DjangoModelFactory):
"""
Define Analysis1 Factory
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -69,7 +69,7 @@ class Meta:
NAC_category_description = factory.Faker("name")


class OperatingDeliveryCategoryFactory(DjangoModelFactory):
class OperatingDeliveryCategoryFactory(factory.django.DjangoModelFactory):
"""
Define OperatingDeliveryCategory Factory
"""
Expand All @@ -78,7 +78,7 @@ class Meta:
model = OperatingDeliveryCategory


class ExpenditureCategoryFactory(DjangoModelFactory):
class ExpenditureCategoryFactory(factory.django.DjangoModelFactory):
"""
Define ExpenditureCategory Factory
"""
Expand All @@ -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
"""
Expand All @@ -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
"""
Expand All @@ -130,7 +130,7 @@ class Meta:
used_for_budget = False


class HistoricalNaturalCodeFactory(DjangoModelFactory):
class HistoricalNaturalCodeFactory(factory.django.DjangoModelFactory):

active = True
natural_account_code = 87654321
Expand All @@ -141,7 +141,7 @@ class Meta:
model = ArchivedNaturalCode


class ProgrammeCodeFactory(DjangoModelFactory):
class ProgrammeCodeFactory(factory.django.DjangoModelFactory):
"""
Define ProgrammeCode Factory
"""
Expand All @@ -156,7 +156,7 @@ class Meta:
budget_type = factory.Iterator(BudgetType.objects.all())


class HistoricalProgrammeCodeFactory(DjangoModelFactory):
class HistoricalProgrammeCodeFactory(factory.django.DjangoModelFactory):
"""
Define ArchivedProgrammeCode Factory
"""
Expand All @@ -170,7 +170,7 @@ class Meta:
model = ArchivedProgrammeCode


class InterEntityL1Factory(DjangoModelFactory):
class InterEntityL1Factory(factory.django.DjangoModelFactory):
"""
Define InterEntityL1 Factory
"""
Expand All @@ -179,7 +179,7 @@ class Meta:
model = InterEntityL1


class InterEntityFactory(DjangoModelFactory):
class InterEntityFactory(factory.django.DjangoModelFactory):
"""
Define InterEntity Factory
"""
Expand All @@ -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
"""
Expand All @@ -212,7 +212,7 @@ class Meta:
project_description = "Project Description"


class HistoricalProjectCodeFactory(DjangoModelFactory):
class HistoricalProjectCodeFactory(factory.django.DjangoModelFactory):
"""
Define ArchivedProjectCode Factory
"""
Expand All @@ -225,7 +225,7 @@ class Meta:
model = ArchivedProjectCode


class FCOMappingFactory(DjangoModelFactory):
class FCOMappingFactory(factory.django.DjangoModelFactory):
"""
Define FCOMapping Factory
"""
Expand All @@ -238,7 +238,7 @@ class Meta:
model = FCOMapping


class HistoricalFCOMappingFactory(DjangoModelFactory):
class HistoricalFCOMappingFactory(factory.django.DjangoModelFactory):
"""
Define ArchivedFCOMapping Factory
"""
Expand Down
3 changes: 2 additions & 1 deletion core/test/factories.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
16 changes: 8 additions & 8 deletions costcentre/test/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from factory.django import DjangoModelFactory
import factory
from faker import Faker

from core.models import FinancialYear
Expand All @@ -15,7 +15,7 @@
fake = Faker()


class DepartmentalGroupFactory(DjangoModelFactory):
class DepartmentalGroupFactory(factory.django.DjangoModelFactory):
"""
Define DepartmentalGroup Factory
"""
Expand All @@ -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",)
Expand All @@ -41,15 +41,15 @@ class Meta:
active = True


class FinancialYearFactory(DjangoModelFactory):
class FinancialYearFactory(factory.django.DjangoModelFactory):
class Meta:
model = FinancialYear
django_get_or_create = ("financial_year",)

financial_year = 2019


class FinanceBusinessPartnerFactory(DjangoModelFactory):
class FinanceBusinessPartnerFactory(factory.django.DjangoModelFactory):
class Meta:
model = BusinessPartner
django_get_or_create = ("name", "surname")
Expand All @@ -58,15 +58,15 @@ class Meta:
surname = "FBP"


class BSCEFactory(DjangoModelFactory):
class BSCEFactory(factory.django.DjangoModelFactory):
class Meta:
model = BSCEEmail
django_get_or_create = ("bsce_email",)

bsce_email = "[email protected]" # /PS-IGNORE


class CostCentreFactory(DjangoModelFactory):
class CostCentreFactory(factory.django.DjangoModelFactory):
"""
Define CostCentre Factory
"""
Expand All @@ -83,7 +83,7 @@ class Meta:
bsce_email = factory.SubFactory(BSCEFactory)


class ArchivedCostCentreFactory(DjangoModelFactory):
class ArchivedCostCentreFactory(factory.django.DjangoModelFactory):
class Meta:
model = ArchivedCostCentre

Expand Down
4 changes: 2 additions & 2 deletions download_file/test/factories.py
Original file line number Diff line number Diff line change
@@ -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
20 changes: 10 additions & 10 deletions forecast/test/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from factory.django import DjangoModelFactory
import factory

from chartofaccountDIT.test.factories import NaturalCodeFactory, ProgrammeCodeFactory
from core.models import FinancialYear
Expand All @@ -14,7 +14,7 @@
)


class FinancialPeriodFactory(DjangoModelFactory):
class FinancialPeriodFactory(factory.django.DjangoModelFactory):
class Meta:
model = FinancialPeriod

Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
10 changes: 5 additions & 5 deletions gifthospitality/test/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from factory.django import DjangoModelFactory
import factory

from gifthospitality.models import (
GiftAndHospitality,
Expand All @@ -8,7 +8,7 @@
)


class GiftsAndHospitalityFactory(DjangoModelFactory):
class GiftsAndHospitalityFactory(factory.django.DjangoModelFactory):
"""
Define GiftsAndHospitality Factory
"""
Expand All @@ -17,7 +17,7 @@ class Meta:
model = GiftAndHospitality


class GiftsAndHospitalityCategoryFactory(DjangoModelFactory):
class GiftsAndHospitalityCategoryFactory(factory.django.DjangoModelFactory):
"""
Define GiftsAndHospitalityCategory Factory
"""
Expand All @@ -26,7 +26,7 @@ class Meta:
model = GiftAndHospitalityCategory


class GiftsAndHospitalityClassificationFactory(DjangoModelFactory):
class GiftsAndHospitalityClassificationFactory(factory.django.DjangoModelFactory):
"""
Define CostCentre Factory
"""
Expand All @@ -35,7 +35,7 @@ class Meta:
model = GiftAndHospitalityClassification


class GiftsAndHospitalityCompanyFactory(DjangoModelFactory):
class GiftsAndHospitalityCompanyFactory(factory.django.DjangoModelFactory):
"""
Define CostCentre Factory
"""
Expand Down
Loading

0 comments on commit 6b98b44

Please sign in to comment.