Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
chore: updated factory dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
zubair-ce07 committed Nov 12, 2023
1 parent 74533eb commit 05026c7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions ecommerce/core/management/commands/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
from oscar.core.loading import get_model


class PaymentEventFactory(factory.DjangoModelFactory):
class PaymentEventFactory(factory.django.DjangoModelFactory):
id = FuzzyInteger(1000, 999999)

class Meta:
model = get_model('order', 'PaymentEvent')


class SuperUserFactory(factory.DjangoModelFactory):
class SuperUserFactory(factory.django.DjangoModelFactory):
id = FuzzyInteger(1000, 999999)
is_superuser = True
lms_user_id = 56765
Expand Down
2 changes: 1 addition & 1 deletion ecommerce/courses/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ecommerce.courses.models import Course


class CourseFactory(factory.DjangoModelFactory):
class CourseFactory(factory.django.DjangoModelFactory):
class Meta:
model = Course

Expand Down
4 changes: 2 additions & 2 deletions ecommerce/extensions/refund/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ProductClass = get_model("catalogue", "ProductClass")


class RefundFactory(factory.DjangoModelFactory):
class RefundFactory(factory.django.DjangoModelFactory):
status = getattr(settings, 'OSCAR_INITIAL_REFUND_STATUS', REFUND.OPEN)
user = factory.SubFactory(UserFactory)
total_credit_excl_tax = Decimal(1.00)
Expand All @@ -42,7 +42,7 @@ class Meta:
model = get_model('refund', 'Refund')


class RefundLineFactory(factory.DjangoModelFactory):
class RefundLineFactory(factory.django.DjangoModelFactory):
status = getattr(settings, 'OSCAR_INITIAL_REFUND_LINE_STATUS', REFUND_LINE.OPEN)
refund = factory.SubFactory(RefundFactory)
line_credit_excl_tax = Decimal(1.00)
Expand Down
10 changes: 5 additions & 5 deletions ecommerce/extensions/test/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class EnterpriseOfferFactory(ConditionalOfferFactory):
emails_for_usage_alert = '[email protected], [email protected]'


class OfferAssignmentFactory(factory.DjangoModelFactory):
class OfferAssignmentFactory(factory.django.DjangoModelFactory):
offer = factory.SubFactory(EnterpriseOfferFactory)
code = factory.Sequence(lambda n: 'VOUCHERCODE{number}'.format(number=n))
user_email = factory.Sequence(lambda n: 'example_%[email protected]' % n)
Expand All @@ -322,7 +322,7 @@ class DynamicPercentageDiscountBenefitFactory(BenefitFactory):
proxy_class = class_path(DynamicPercentageDiscountBenefit)


class CodeAssignmentNudgeEmailTemplatesFactory(factory.DjangoModelFactory):
class CodeAssignmentNudgeEmailTemplatesFactory(factory.django.DjangoModelFactory):
email_greeting = factory.Faker('sentence')
email_closing = factory.Faker('sentence')
email_subject = factory.Faker('sentence')
Expand All @@ -333,7 +333,7 @@ class Meta:
model = CodeAssignmentNudgeEmailTemplates


class CodeAssignmentNudgeEmailsFactory(factory.DjangoModelFactory):
class CodeAssignmentNudgeEmailsFactory(factory.django.DjangoModelFactory):
email_template = factory.SubFactory(CodeAssignmentNudgeEmailTemplatesFactory)
user_email = factory.Sequence(lambda n: 'learner_%[email protected]' % n)
email_date = datetime.now()
Expand All @@ -343,7 +343,7 @@ class Meta:
model = CodeAssignmentNudgeEmails


class SDNFallbackMetadataFactory(factory.DjangoModelFactory):
class SDNFallbackMetadataFactory(factory.django.DjangoModelFactory):
class Meta:
model = SDNFallbackMetadata

Expand All @@ -352,7 +352,7 @@ class Meta:
download_timestamp = datetime.now() - timedelta(days=10)


class SDNFallbackDataFactory(factory.DjangoModelFactory):
class SDNFallbackDataFactory(factory.django.DjangoModelFactory):
class Meta:
model = SDNFallbackData

Expand Down
2 changes: 1 addition & 1 deletion ecommerce/referrals/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ecommerce.tests.factories import SiteFactory


class ReferralFactory(factory.DjangoModelFactory):
class ReferralFactory(factory.django.DjangoModelFactory):
class Meta:
model = Referral

Expand Down
8 changes: 4 additions & 4 deletions ecommerce/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from ecommerce.core.models import SiteConfiguration


class PartnerFactory(factory.DjangoModelFactory):
class PartnerFactory(factory.django.DjangoModelFactory):
class Meta:
model = get_model('partner', 'Partner')
django_get_or_create = ('name',)
Expand All @@ -20,15 +20,15 @@ class Meta:
short_code = FuzzyText(length=8)


class SiteFactory(factory.DjangoModelFactory):
class SiteFactory(factory.django.DjangoModelFactory):
class Meta:
model = Site

domain = FuzzyText(suffix='.fake')
name = FuzzyText()


class SiteConfigurationFactory(factory.DjangoModelFactory):
class SiteConfigurationFactory(factory.django.DjangoModelFactory):
class Meta:
model = SiteConfiguration

Expand All @@ -48,7 +48,7 @@ class StockRecordFactory(OscarStockRecordFactory):
price_currency = 'USD'


class UserFactory(factory.DjangoModelFactory):
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = get_model('core', 'User')

Expand Down

0 comments on commit 05026c7

Please sign in to comment.