diff --git a/ecommerce/core/management/commands/tests/factories.py b/ecommerce/core/management/commands/tests/factories.py index 5afde342f67..042988476ec 100644 --- a/ecommerce/core/management/commands/tests/factories.py +++ b/ecommerce/core/management/commands/tests/factories.py @@ -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 diff --git a/ecommerce/courses/tests/factories.py b/ecommerce/courses/tests/factories.py index 40175241bf2..44a7e406e32 100644 --- a/ecommerce/courses/tests/factories.py +++ b/ecommerce/courses/tests/factories.py @@ -6,7 +6,7 @@ from ecommerce.courses.models import Course -class CourseFactory(factory.DjangoModelFactory): +class CourseFactory(factory.django.DjangoModelFactory): class Meta: model = Course diff --git a/ecommerce/extensions/refund/tests/factories.py b/ecommerce/extensions/refund/tests/factories.py index 90d3b9b6c8d..32dda784473 100644 --- a/ecommerce/extensions/refund/tests/factories.py +++ b/ecommerce/extensions/refund/tests/factories.py @@ -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) @@ -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) diff --git a/ecommerce/extensions/test/factories.py b/ecommerce/extensions/test/factories.py index 511beae1b5c..826b421eb20 100644 --- a/ecommerce/extensions/test/factories.py +++ b/ecommerce/extensions/test/factories.py @@ -306,7 +306,7 @@ class EnterpriseOfferFactory(ConditionalOfferFactory): emails_for_usage_alert = 'example_1@example.com, example_2@example.com' -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_%s@example.com' % n) @@ -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') @@ -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_%s@example.com' % n) email_date = datetime.now() @@ -343,7 +343,7 @@ class Meta: model = CodeAssignmentNudgeEmails -class SDNFallbackMetadataFactory(factory.DjangoModelFactory): +class SDNFallbackMetadataFactory(factory.django.DjangoModelFactory): class Meta: model = SDNFallbackMetadata @@ -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 diff --git a/ecommerce/referrals/tests/factories.py b/ecommerce/referrals/tests/factories.py index cc7bd57ce7a..bc8b4bd7fb2 100644 --- a/ecommerce/referrals/tests/factories.py +++ b/ecommerce/referrals/tests/factories.py @@ -7,7 +7,7 @@ from ecommerce.tests.factories import SiteFactory -class ReferralFactory(factory.DjangoModelFactory): +class ReferralFactory(factory.django.DjangoModelFactory): class Meta: model = Referral diff --git a/ecommerce/tests/factories.py b/ecommerce/tests/factories.py index 74e8ca29789..b9bf3ab585f 100644 --- a/ecommerce/tests/factories.py +++ b/ecommerce/tests/factories.py @@ -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',) @@ -20,7 +20,7 @@ class Meta: short_code = FuzzyText(length=8) -class SiteFactory(factory.DjangoModelFactory): +class SiteFactory(factory.django.DjangoModelFactory): class Meta: model = Site @@ -28,7 +28,7 @@ class Meta: name = FuzzyText() -class SiteConfigurationFactory(factory.DjangoModelFactory): +class SiteConfigurationFactory(factory.django.DjangoModelFactory): class Meta: model = SiteConfiguration @@ -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')