浏览代码

Apply isort fixes on the whole project.

master
Samir Shah 5 年前
父节点
当前提交
3f67ce9b76
共有 100 个文件被更改,包括 173 次插入199 次删除
  1. 1
    1
      setup.cfg
  2. 0
    1
      src/oscar/apps/basket/reports.py
  3. 2
    1
      src/oscar/apps/catalogue/abstract_models.py
  4. 1
    1
      src/oscar/apps/catalogue/managers.py
  5. 0
    1
      src/oscar/apps/catalogue/reviews/abstract_models.py
  6. 0
    1
      src/oscar/apps/customer/abstract_models.py
  7. 1
    2
      src/oscar/apps/customer/forms.py
  8. 1
    1
      src/oscar/apps/customer/mixins.py
  9. 0
    1
      src/oscar/apps/customer/utils.py
  10. 1
    1
      src/oscar/apps/dashboard/catalogue/forms.py
  11. 0
    1
      src/oscar/apps/dashboard/catalogue/views.py
  12. 1
    1
      src/oscar/apps/dashboard/reports/reports.py
  13. 1
    2
      src/oscar/apps/dashboard/reviews/forms.py
  14. 0
    1
      src/oscar/apps/dashboard/users/tables.py
  15. 1
    1
      src/oscar/apps/dashboard/views.py
  16. 5
    4
      src/oscar/apps/offer/abstract_models.py
  17. 1
    1
      src/oscar/apps/offer/conditions.py
  18. 1
    0
      src/oscar/apps/offer/managers.py
  19. 1
    1
      src/oscar/apps/offer/queryset.py
  20. 0
    1
      src/oscar/apps/order/abstract_models.py
  21. 0
    1
      src/oscar/core/application.py
  22. 2
    2
      src/oscar/core/compat.py
  23. 1
    3
      src/oscar/core/utils.py
  24. 4
    2
      src/oscar/core/validators.py
  25. 2
    1
      src/oscar/templatetags/category_tags.py
  26. 1
    1
      src/oscar/templatetags/datetime_filters.py
  27. 0
    1
      src/oscar/templatetags/purchase_info_tags.py
  28. 2
    3
      src/oscar/test/factories/__init__.py
  29. 1
    1
      src/oscar/test/factories/utils.py
  30. 0
    1
      src/oscar/test/factories/voucher.py
  31. 3
    4
      src/oscar/test/utils.py
  32. 2
    1
      tests/_site/apps/catalogue/views.py
  33. 2
    1
      tests/_site/apps/customer/views.py
  34. 1
    1
      tests/_site/apps/partner/models.py
  35. 3
    3
      tests/_site/myauth/models.py
  36. 1
    1
      tests/_site/urls.py
  37. 2
    2
      tests/functional/basket/test_manipulation.py
  38. 3
    2
      tests/functional/catalogue/test_review.py
  39. 1
    1
      tests/functional/checkout/__init__.py
  40. 2
    1
      tests/functional/checkout/test_customer_checkout.py
  41. 6
    5
      tests/functional/checkout/test_guest_checkout.py
  42. 3
    4
      tests/functional/customer/test_alert.py
  43. 2
    3
      tests/functional/customer/test_auth.py
  44. 0
    1
      tests/functional/customer/test_history.py
  45. 3
    3
      tests/functional/customer/test_notification.py
  46. 4
    5
      tests/functional/customer/test_profile.py
  47. 1
    2
      tests/functional/customer/test_wishlists.py
  48. 3
    3
      tests/functional/dashboard/test_catalogue.py
  49. 3
    3
      tests/functional/dashboard/test_catalogue_option.py
  50. 7
    6
      tests/functional/dashboard/test_catalogue_option_group.py
  51. 2
    2
      tests/functional/dashboard/test_category.py
  52. 4
    3
      tests/functional/dashboard/test_dashboard.py
  53. 1
    1
      tests/functional/dashboard/test_offer.py
  54. 4
    5
      tests/functional/dashboard/test_order.py
  55. 1
    1
      tests/functional/dashboard/test_partner.py
  56. 8
    9
      tests/functional/dashboard/test_product.py
  57. 2
    3
      tests/functional/dashboard/test_range.py
  58. 0
    1
      tests/functional/dashboard/test_review.py
  59. 1
    1
      tests/functional/dashboard/test_shipping.py
  60. 1
    2
      tests/functional/dashboard/test_widgets.py
  61. 4
    3
      tests/functional/dashboard/testcases.py
  62. 1
    2
      tests/functional/test_basket.py
  63. 1
    2
      tests/functional/test_stock_alert.py
  64. 1
    1
      tests/integration/address/test_forms.py
  65. 3
    5
      tests/integration/address/test_models.py
  66. 1
    2
      tests/integration/basket/test_forms.py
  67. 1
    1
      tests/integration/basket/test_middleware.py
  68. 3
    4
      tests/integration/catalogue/reviews/test_models.py
  69. 2
    2
      tests/integration/catalogue/test_attributes.py
  70. 1
    1
      tests/integration/catalogue/test_category.py
  71. 1
    2
      tests/integration/catalogue/test_options.py
  72. 4
    5
      tests/integration/catalogue/test_product.py
  73. 1
    2
      tests/integration/catalogue/test_product_search_handler_setting.py
  74. 3
    3
      tests/integration/checkout/test_mixins.py
  75. 1
    1
      tests/integration/checkout/test_session.py
  76. 1
    1
      tests/integration/core/test_compat.py
  77. 1
    2
      tests/integration/core/test_customisation.py
  78. 4
    4
      tests/integration/core/test_loading.py
  79. 1
    0
      tests/integration/core/test_prices.py
  80. 3
    2
      tests/integration/core/test_validator.py
  81. 1
    3
      tests/integration/customer/test_alert.py
  82. 1
    2
      tests/integration/customer/test_customer.py
  83. 3
    4
      tests/integration/customer/test_dispatcher.py
  84. 1
    1
      tests/integration/customer/test_history.py
  85. 1
    2
      tests/integration/customer/test_utils.py
  86. 2
    2
      tests/integration/dashboard/test_offer_forms.py
  87. 0
    1
      tests/integration/dashboard/test_reviews.py
  88. 3
    2
      tests/integration/dashboard/test_voucher_form.py
  89. 2
    1
      tests/integration/forms/test_field.py
  90. 1
    1
      tests/integration/offer/test_absolute_benefit.py
  91. 3
    4
      tests/integration/offer/test_applicator.py
  92. 1
    1
      tests/integration/offer/test_benefit.py
  93. 1
    1
      tests/integration/offer/test_combination.py
  94. 1
    2
      tests/integration/offer/test_condition.py
  95. 2
    3
      tests/integration/offer/test_conditionaloffer_delete.py
  96. 2
    1
      tests/integration/offer/test_custom.py
  97. 1
    1
      tests/integration/offer/test_custom_range.py
  98. 1
    1
      tests/integration/offer/test_manager.py
  99. 1
    1
      tests/integration/offer/test_multibuy_benefit.py
  100. 0
    0
      tests/integration/offer/test_post_order_action.py

+ 1
- 1
setup.cfg 查看文件

17
 balanced_wrapping = true
17
 balanced_wrapping = true
18
 known_first_party = oscar,tests
18
 known_first_party = oscar,tests
19
 use_parentheses = true
19
 use_parentheses = true
20
-skip_glob=*/src/oscar/**/migrations/*.py,*/tests/**/*.py
20
+skip_glob=*/migrations/*

+ 0
- 1
src/oscar/apps/basket/reports.py 查看文件

2
 
2
 
3
 from oscar.core.loading import get_class, get_model
3
 from oscar.core.loading import get_class, get_model
4
 
4
 
5
-
6
 ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator')
5
 ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator')
7
 ReportCSVFormatter = get_class('dashboard.reports.reports',
6
 ReportCSVFormatter = get_class('dashboard.reports.reports',
8
                                'ReportCSVFormatter')
7
                                'ReportCSVFormatter')

+ 2
- 1
src/oscar/apps/catalogue/abstract_models.py 查看文件

16
 from django.utils.functional import cached_property
16
 from django.utils.functional import cached_property
17
 from django.utils.html import strip_tags
17
 from django.utils.html import strip_tags
18
 from django.utils.safestring import mark_safe
18
 from django.utils.safestring import mark_safe
19
+from django.utils.translation import get_language
19
 from django.utils.translation import gettext_lazy as _
20
 from django.utils.translation import gettext_lazy as _
20
-from django.utils.translation import get_language, pgettext_lazy
21
+from django.utils.translation import pgettext_lazy
21
 from treebeard.mp_tree import MP_Node
22
 from treebeard.mp_tree import MP_Node
22
 
23
 
23
 from oscar.core.loading import get_class, get_model
24
 from oscar.core.loading import get_class, get_model

+ 1
- 1
src/oscar/apps/catalogue/managers.py 查看文件

1
 from collections import defaultdict
1
 from collections import defaultdict
2
 
2
 
3
 from django.db import models
3
 from django.db import models
4
-from django.db.models import OuterRef, Exists
4
+from django.db.models import Exists, OuterRef
5
 from django.db.models.constants import LOOKUP_SEP
5
 from django.db.models.constants import LOOKUP_SEP
6
 
6
 
7
 from oscar.core.decorators import deprecated
7
 from oscar.core.decorators import deprecated

+ 0
- 1
src/oscar/apps/catalogue/reviews/abstract_models.py 查看文件

10
 from oscar.core.compat import AUTH_USER_MODEL
10
 from oscar.core.compat import AUTH_USER_MODEL
11
 from oscar.core.loading import get_class
11
 from oscar.core.loading import get_class
12
 
12
 
13
-
14
 ProductReviewQuerySet = get_class('catalogue.reviews.managers', 'ProductReviewQuerySet')
13
 ProductReviewQuerySet = get_class('catalogue.reviews.managers', 'ProductReviewQuerySet')
15
 
14
 
16
 
15
 

+ 0
- 1
src/oscar/apps/customer/abstract_models.py 查看文件

14
 from oscar.core.loading import get_class
14
 from oscar.core.loading import get_class
15
 from oscar.models.fields import AutoSlugField
15
 from oscar.models.fields import AutoSlugField
16
 
16
 
17
-
18
 CommunicationTypeManager = get_class('customer.managers', 'CommunicationTypeManager')
17
 CommunicationTypeManager = get_class('customer.managers', 'CommunicationTypeManager')
19
 
18
 
20
 
19
 

+ 1
- 2
src/oscar/apps/customer/forms.py 查看文件

13
 from django.utils.translation import pgettext_lazy
13
 from django.utils.translation import pgettext_lazy
14
 
14
 
15
 from oscar.apps.customer.utils import get_password_reset_url, normalise_email
15
 from oscar.apps.customer.utils import get_password_reset_url, normalise_email
16
-from oscar.core.compat import (
17
-    existing_user_fields, get_user_model)
16
+from oscar.core.compat import existing_user_fields, get_user_model
18
 from oscar.core.loading import get_class, get_model, get_profile_class
17
 from oscar.core.loading import get_class, get_model, get_profile_class
19
 from oscar.forms import widgets
18
 from oscar.forms import widgets
20
 
19
 

+ 1
- 1
src/oscar/apps/customer/mixins.py 查看文件

1
 import logging
1
 import logging
2
 
2
 
3
 from django.conf import settings
3
 from django.conf import settings
4
-from django.contrib.auth import login as auth_login
5
 from django.contrib.auth import authenticate
4
 from django.contrib.auth import authenticate
5
+from django.contrib.auth import login as auth_login
6
 from django.contrib.sites.shortcuts import get_current_site
6
 from django.contrib.sites.shortcuts import get_current_site
7
 
7
 
8
 from oscar.apps.customer.signals import user_registered
8
 from oscar.apps.customer.signals import user_registered

+ 0
- 1
src/oscar/apps/customer/utils.py 查看文件

9
 from oscar.core.compat import urlsafe_base64_encode
9
 from oscar.core.compat import urlsafe_base64_encode
10
 from oscar.core.loading import get_model
10
 from oscar.core.loading import get_model
11
 
11
 
12
-
13
 CommunicationEvent = get_model('order', 'CommunicationEvent')
12
 CommunicationEvent = get_model('order', 'CommunicationEvent')
14
 Email = get_model('customer', 'Email')
13
 Email = get_model('customer', 'Email')
15
 
14
 

+ 1
- 1
src/oscar/apps/dashboard/catalogue/forms.py 查看文件

3
 from django.utils.translation import gettext_lazy as _
3
 from django.utils.translation import gettext_lazy as _
4
 from treebeard.forms import movenodeform_factory
4
 from treebeard.forms import movenodeform_factory
5
 
5
 
6
-from oscar.core.loading import get_class, get_model, get_classes
6
+from oscar.core.loading import get_class, get_classes, get_model
7
 from oscar.core.utils import slugify
7
 from oscar.core.utils import slugify
8
 from oscar.forms.widgets import DateTimePickerInput, ImageInput
8
 from oscar.forms.widgets import DateTimePickerInput, ImageInput
9
 
9
 

+ 0
- 1
src/oscar/apps/dashboard/catalogue/views.py 查看文件

12
 from oscar.core.loading import get_classes, get_model
12
 from oscar.core.loading import get_classes, get_model
13
 from oscar.views.generic import ObjectLookupView
13
 from oscar.views.generic import ObjectLookupView
14
 
14
 
15
-
16
 (ProductForm,
15
 (ProductForm,
17
  ProductClassSelectForm,
16
  ProductClassSelectForm,
18
  ProductSearchForm,
17
  ProductSearchForm,

+ 1
- 1
src/oscar/apps/dashboard/reports/reports.py 查看文件

1
 from datetime import datetime, time
1
 from datetime import datetime, time
2
 
2
 
3
-from django.utils import timezone
4
 from django.http import HttpResponse
3
 from django.http import HttpResponse
5
 from django.template.defaultfilters import date
4
 from django.template.defaultfilters import date
5
+from django.utils import timezone
6
 from django.utils.translation import gettext_lazy as _
6
 from django.utils.translation import gettext_lazy as _
7
 
7
 
8
 from oscar.core import utils
8
 from oscar.core import utils

+ 1
- 2
src/oscar/apps/dashboard/reviews/forms.py 查看文件

1
 from django import forms
1
 from django import forms
2
 from django.utils.translation import gettext_lazy as _
2
 from django.utils.translation import gettext_lazy as _
3
 
3
 
4
-from oscar.core.loading import get_model, get_class
5
-
4
+from oscar.core.loading import get_class, get_model
6
 
5
 
7
 ProductReview = get_model('reviews', 'productreview')
6
 ProductReview = get_model('reviews', 'productreview')
8
 DatePickerInput = get_class('oscar.forms.widgets', 'DatePickerInput')
7
 DatePickerInput = get_class('oscar.forms.widgets', 'DatePickerInput')

+ 0
- 1
src/oscar/apps/dashboard/users/tables.py 查看文件

1
 from django.utils.translation import gettext_lazy as _
1
 from django.utils.translation import gettext_lazy as _
2
-
3
 from django_tables2 import A, Column, LinkColumn, TemplateColumn
2
 from django_tables2 import A, Column, LinkColumn, TemplateColumn
4
 
3
 
5
 from oscar.core.loading import get_class
4
 from oscar.core.loading import get_class

+ 1
- 1
src/oscar/apps/dashboard/views.py 查看文件

1
 import json
1
 import json
2
 from datetime import timedelta
2
 from datetime import timedelta
3
-from decimal import Decimal as D
4
 from decimal import ROUND_UP
3
 from decimal import ROUND_UP
4
+from decimal import Decimal as D
5
 
5
 
6
 from django.contrib import messages
6
 from django.contrib import messages
7
 from django.db.models import Avg, Count, Sum
7
 from django.db.models import Avg, Count, Sum

+ 5
- 4
src/oscar/apps/offer/abstract_models.py 查看文件

1
 import operator
1
 import operator
2
 import os
2
 import os
3
 import re
3
 import re
4
-from decimal import Decimal as D
5
 from decimal import ROUND_DOWN
4
 from decimal import ROUND_DOWN
5
+from decimal import Decimal as D
6
 
6
 
7
 from django.conf import settings
7
 from django.conf import settings
8
 from django.core import exceptions
8
 from django.core import exceptions
9
 from django.db import models
9
 from django.db import models
10
-from django.db.models.lookups import StartsWith
10
+from django.db.models import Exists, OuterRef
11
 from django.db.models.fields import Field
11
 from django.db.models.fields import Field
12
+from django.db.models.lookups import StartsWith
12
 from django.db.models.query import Q
13
 from django.db.models.query import Q
13
-from django.db.models import OuterRef, Exists
14
 from django.template.defaultfilters import date as date_filter
14
 from django.template.defaultfilters import date as date_filter
15
 from django.urls import reverse
15
 from django.urls import reverse
16
 from django.utils.functional import cached_property
16
 from django.utils.functional import cached_property
19
 
19
 
20
 from oscar.core.compat import AUTH_USER_MODEL
20
 from oscar.core.compat import AUTH_USER_MODEL
21
 from oscar.core.decorators import deprecated
21
 from oscar.core.decorators import deprecated
22
-from oscar.core.loading import get_class, get_classes, get_model, cached_import_string
22
+from oscar.core.loading import (
23
+    cached_import_string, get_class, get_classes, get_model)
23
 from oscar.models import fields
24
 from oscar.models import fields
24
 from oscar.templatetags.currency_filters import currency
25
 from oscar.templatetags.currency_filters import currency
25
 
26
 

+ 1
- 1
src/oscar/apps/offer/conditions.py 查看文件

1
-from decimal import Decimal as D
2
 from decimal import ROUND_UP
1
 from decimal import ROUND_UP
2
+from decimal import Decimal as D
3
 
3
 
4
 from django.utils.translation import gettext_lazy as _
4
 from django.utils.translation import gettext_lazy as _
5
 from django.utils.translation import ungettext
5
 from django.utils.translation import ungettext

+ 1
- 0
src/oscar/apps/offer/managers.py 查看文件

1
 from django.db import models
1
 from django.db import models
2
 from django.utils.timezone import now
2
 from django.utils.timezone import now
3
+
3
 from .queryset import RangeQuerySet
4
 from .queryset import RangeQuerySet
4
 
5
 
5
 
6
 

+ 1
- 1
src/oscar/apps/offer/queryset.py 查看文件

1
 from django.db import models
1
 from django.db import models
2
-from django.db.models import OuterRef, Exists
2
+from django.db.models import Exists, OuterRef
3
 
3
 
4
 
4
 
5
 def product_class_as_queryset(product):
5
 def product_class_as_queryset(product):

+ 0
- 1
src/oscar/apps/order/abstract_models.py 查看文件

25
 
25
 
26
 from . import exceptions
26
 from . import exceptions
27
 
27
 
28
-
29
 logger = logging.getLogger('oscar.order')
28
 logger = logging.getLogger('oscar.order')
30
 
29
 
31
 
30
 

+ 0
- 1
src/oscar/core/application.py 查看文件

4
 
4
 
5
 from oscar.core.loading import feature_hidden
5
 from oscar.core.loading import feature_hidden
6
 
6
 
7
-
8
 try:
7
 try:
9
     # Django 2
8
     # Django 2
10
     from django.urls import URLPattern
9
     from django.urls import URLPattern

+ 2
- 2
src/oscar/core/compat.py 查看文件

3
 from django.conf import settings
3
 from django.conf import settings
4
 from django.contrib.auth.models import User
4
 from django.contrib.auth.models import User
5
 from django.core.exceptions import ImproperlyConfigured
5
 from django.core.exceptions import ImproperlyConfigured
6
-from django.utils.http import urlsafe_base64_encode as django_urlsafe_base64_encode
6
+from django.utils.http import (
7
+    urlsafe_base64_encode as django_urlsafe_base64_encode)
7
 
8
 
8
 from oscar.core.loading import get_model
9
 from oscar.core.loading import get_model
9
 
10
 
10
-
11
 # A setting that can be used in foreign key declarations
11
 # A setting that can be used in foreign key declarations
12
 AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
12
 AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
13
 try:
13
 try:

+ 1
- 3
src/oscar/core/utils.py 查看文件

5
 import unicodedata
5
 import unicodedata
6
 
6
 
7
 from babel.dates import format_timedelta as format_td
7
 from babel.dates import format_timedelta as format_td
8
-
9
 from django.conf import settings
8
 from django.conf import settings
10
 from django.shortcuts import redirect, resolve_url
9
 from django.shortcuts import redirect, resolve_url
11
-from django.utils.translation import get_language, to_locale
12
 from django.template.defaultfilters import date as date_filter
10
 from django.template.defaultfilters import date as date_filter
13
 from django.utils.http import is_safe_url
11
 from django.utils.http import is_safe_url
14
 from django.utils.module_loading import import_string
12
 from django.utils.module_loading import import_string
15
 from django.utils.text import slugify as django_slugify
13
 from django.utils.text import slugify as django_slugify
16
 from django.utils.timezone import get_current_timezone, is_naive, make_aware
14
 from django.utils.timezone import get_current_timezone, is_naive, make_aware
17
-
15
+from django.utils.translation import get_language, to_locale
18
 
16
 
19
 SLUGIFY_RE = re.compile(r'[^\w\s-]', re.UNICODE)
17
 SLUGIFY_RE = re.compile(r'[^\w\s-]', re.UNICODE)
20
 
18
 

+ 4
- 2
src/oscar/core/validators.py 查看文件

4
 from django.core import validators
4
 from django.core import validators
5
 from django.core.exceptions import ValidationError
5
 from django.core.exceptions import ValidationError
6
 from django.http import Http404
6
 from django.http import Http404
7
-from django.urls import resolve, get_urlconf
8
-from django.utils.translation import gettext_lazy as _, get_language_from_path, get_language, override
7
+from django.urls import get_urlconf, resolve
8
+from django.utils.translation import get_language, get_language_from_path
9
+from django.utils.translation import gettext_lazy as _
10
+from django.utils.translation import override
9
 
11
 
10
 from oscar.core.loading import get_model
12
 from oscar.core.loading import get_model
11
 
13
 

+ 2
- 1
src/oscar/templatetags/category_tags.py 查看文件

1
-from six import with_metaclass
2
 from django import template
1
 from django import template
2
+from six import with_metaclass
3
+
3
 from oscar.core.loading import get_model
4
 from oscar.core.loading import get_model
4
 
5
 
5
 register = template.Library()
6
 register = template.Library()

+ 1
- 1
src/oscar/templatetags/datetime_filters.py 查看文件

1
 from django import template
1
 from django import template
2
-from oscar.core.utils import format_timedelta
3
 
2
 
3
+from oscar.core.utils import format_timedelta
4
 
4
 
5
 register = template.Library()
5
 register = template.Library()
6
 
6
 

+ 0
- 1
src/oscar/templatetags/purchase_info_tags.py 查看文件

1
 from django import template
1
 from django import template
2
 
2
 
3
-
4
 register = template.Library()
3
 register = template.Library()
5
 
4
 
6
 
5
 

+ 2
- 3
src/oscar/test/factories/__init__.py 查看文件

1
 # coding=utf-8
1
 # coding=utf-8
2
-from decimal import Decimal as D
3
-import random
4
 import datetime
2
 import datetime
3
+import random
4
+from decimal import Decimal as D
5
 
5
 
6
 from django.conf import settings
6
 from django.conf import settings
7
 from django.utils import timezone
7
 from django.utils import timezone
20
 from oscar.test.factories.voucher import *  # noqa
20
 from oscar.test.factories.voucher import *  # noqa
21
 from oscar.test.factories.wishlists import *  # noqa
21
 from oscar.test.factories.wishlists import *  # noqa
22
 
22
 
23
-
24
 Basket = get_model('basket', 'Basket')
23
 Basket = get_model('basket', 'Basket')
25
 Free = get_class('shipping.methods', 'Free')
24
 Free = get_class('shipping.methods', 'Free')
26
 Voucher = get_model('voucher', 'Voucher')
25
 Voucher = get_model('voucher', 'Voucher')

+ 1
- 1
src/oscar/test/factories/utils.py 查看文件

1
-from decimal import Decimal as D
2
 from decimal import ROUND_HALF_UP
1
 from decimal import ROUND_HALF_UP
2
+from decimal import Decimal as D
3
 
3
 
4
 
4
 
5
 def tax_subtract(price, tax_percentage=21):
5
 def tax_subtract(price, tax_percentage=21):

+ 0
- 1
src/oscar/test/factories/voucher.py 查看文件

6
 from oscar.core.loading import get_model
6
 from oscar.core.loading import get_model
7
 from oscar.test.factories import ConditionalOfferFactory
7
 from oscar.test.factories import ConditionalOfferFactory
8
 
8
 
9
-
10
 __all__ = ['VoucherFactory', 'VoucherSetFactory']
9
 __all__ = ['VoucherFactory', 'VoucherSetFactory']
11
 
10
 
12
 
11
 

+ 3
- 4
src/oscar/test/utils.py 查看文件

1
-import queue
2
 import os
1
 import os
2
+import queue
3
 import shutil
3
 import shutil
4
 import threading
4
 import threading
5
 from datetime import date
5
 from datetime import date
6
 
6
 
7
-from django.contrib.auth.models import AnonymousUser
8
 from django.conf import settings
7
 from django.conf import settings
8
+from django.contrib.auth.models import AnonymousUser
9
 from django.contrib.messages.storage.fallback import FallbackStorage
9
 from django.contrib.messages.storage.fallback import FallbackStorage
10
 from django.contrib.sessions.backends.db import SessionStore
10
 from django.contrib.sessions.backends.db import SessionStore
11
 from django.core.signing import Signer
11
 from django.core.signing import Signer
12
 from django.db import connection
12
 from django.db import connection
13
 from django.test import RequestFactory as BaseRequestFactory
13
 from django.test import RequestFactory as BaseRequestFactory
14
+from sorl.thumbnail.conf import settings as sorl_settings
14
 
15
 
15
 from oscar.core.loading import get_class, get_model
16
 from oscar.core.loading import get_class, get_model
16
 from oscar.core.thumbnails import get_thumbnailer
17
 from oscar.core.thumbnails import get_thumbnailer
17
 from oscar.test.factories import ProductImageFactory
18
 from oscar.test.factories import ProductImageFactory
18
-from sorl.thumbnail.conf import settings as sorl_settings
19
-
20
 
19
 
21
 OSCAR_IMAGE_FOLDER_FORMATTED = 'images/products/{0}/{1:02d}/'.format(date.today().year, date.today().month)
20
 OSCAR_IMAGE_FOLDER_FORMATTED = 'images/products/{0}/{1:02d}/'.format(date.today().year, date.today().month)
22
 FULL_PATH_TO_IMAGES_FOLDER = os.path.join(settings.MEDIA_ROOT, OSCAR_IMAGE_FOLDER_FORMATTED)
21
 FULL_PATH_TO_IMAGES_FOLDER = os.path.join(settings.MEDIA_ROOT, OSCAR_IMAGE_FOLDER_FORMATTED)

+ 2
- 1
tests/_site/apps/catalogue/views.py 查看文件

1
-from oscar.apps.catalogue.views import ProductDetailView as OscarProductDetailView
1
+from oscar.apps.catalogue.views import (
2
+    ProductDetailView as OscarProductDetailView)
2
 
3
 
3
 
4
 
4
 class ParentProductDetailView(OscarProductDetailView):
5
 class ParentProductDetailView(OscarProductDetailView):

+ 2
- 1
tests/_site/apps/customer/views.py 查看文件

1
-from oscar.apps.customer.views import AccountSummaryView as OscarAccountSummaryView
1
+from oscar.apps.customer.views import (
2
+    AccountSummaryView as OscarAccountSummaryView)
2
 
3
 
3
 
4
 
4
 class AccountSummaryView(OscarAccountSummaryView):
5
 class AccountSummaryView(OscarAccountSummaryView):

+ 1
- 1
tests/_site/apps/partner/models.py 查看文件

8
     offer_name = models.CharField(max_length=128, null=True, blank=True)
8
     offer_name = models.CharField(max_length=128, null=True, blank=True)
9
 
9
 
10
 
10
 
11
-from oscar.apps.partner.models import *  # noqa
11
+from oscar.apps.partner.models import *  # noqa isort:skip

+ 3
- 3
tests/_site/myauth/models.py 查看文件

2
 
2
 
3
 import re
3
 import re
4
 
4
 
5
-from django.utils.translation import gettext_lazy as _
6
-from django.db import models
7
-from django.core import validators
8
 from django.contrib.auth.models import BaseUserManager
5
 from django.contrib.auth.models import BaseUserManager
6
+from django.core import validators
7
+from django.db import models
8
+from django.utils.translation import gettext_lazy as _
9
 
9
 
10
 from oscar.apps.customer.abstract_models import AbstractUser
10
 from oscar.apps.customer.abstract_models import AbstractUser
11
 
11
 

+ 1
- 1
tests/_site/urls.py 查看文件

1
 from django.apps import apps
1
 from django.apps import apps
2
-from django.conf.urls import url, include
2
+from django.conf.urls import include, url
3
 from django.conf.urls.i18n import i18n_patterns
3
 from django.conf.urls.i18n import i18n_patterns
4
 from django.contrib import admin
4
 from django.contrib import admin
5
 from django.contrib.staticfiles.urls import staticfiles_urlpatterns
5
 from django.contrib.staticfiles.urls import staticfiles_urlpatterns

+ 2
- 2
tests/functional/basket/test_manipulation.py 查看文件

1
-from oscar.test.testcases import WebTestCase
2
-from oscar.test import factories
3
 from oscar.apps.basket import models
1
 from oscar.apps.basket import models
2
+from oscar.test import factories
3
+from oscar.test.testcases import WebTestCase
4
 
4
 
5
 
5
 
6
 class TestAddingToBasket(WebTestCase):
6
 class TestAddingToBasket(WebTestCase):

+ 3
- 2
tests/functional/catalogue/test_review.py 查看文件

1
 from django.urls import reverse
1
 from django.urls import reverse
2
-from oscar.test.testcases import WebTestCase
3
-from oscar.test.factories import create_product, UserFactory
2
+
4
 from oscar.apps.catalogue.reviews.signals import review_added
3
 from oscar.apps.catalogue.reviews.signals import review_added
5
 from oscar.test.contextmanagers import mock_signal_receiver
4
 from oscar.test.contextmanagers import mock_signal_receiver
5
+from oscar.test.factories import UserFactory, create_product
6
+from oscar.test.testcases import WebTestCase
6
 
7
 
7
 
8
 
8
 class TestACustomer(WebTestCase):
9
 class TestACustomer(WebTestCase):

+ 1
- 1
tests/functional/checkout/__init__.py 查看文件

2
 
2
 
3
 from django.urls import reverse
3
 from django.urls import reverse
4
 
4
 
5
-from oscar.core.loading import get_model, get_class
5
+from oscar.core.loading import get_class, get_model
6
 from oscar.test import factories
6
 from oscar.test import factories
7
 
7
 
8
 UserAddress = get_model('address', 'UserAddress')
8
 UserAddress = get_model('address', 'UserAddress')

+ 2
- 1
tests/functional/checkout/test_customer_checkout.py 查看文件

3
 
3
 
4
 from django.urls import reverse
4
 from django.urls import reverse
5
 
5
 
6
-from oscar.core.loading import get_model, get_class
6
+from oscar.core.loading import get_class, get_model
7
 from oscar.test import factories
7
 from oscar.test import factories
8
 from oscar.test.testcases import WebTestCase
8
 from oscar.test.testcases import WebTestCase
9
+
9
 from . import CheckoutMixin
10
 from . import CheckoutMixin
10
 
11
 
11
 Order = get_model('order', 'Order')
12
 Order = get_model('order', 'Order')

+ 6
- 5
tests/functional/checkout/test_guest_checkout.py 查看文件

1
-from importlib import import_module
1
+import sys
2
 from http import client as http_client
2
 from http import client as http_client
3
+from importlib import import_module
3
 from unittest import mock
4
 from unittest import mock
4
-import sys
5
 
5
 
6
-from django.test.utils import override_settings
7
 from django.conf import settings
6
 from django.conf import settings
7
+from django.test.utils import override_settings
8
 from django.urls import clear_url_caches, reverse
8
 from django.urls import clear_url_caches, reverse
9
 from django.utils.http import urlquote
9
 from django.utils.http import urlquote
10
 
10
 
11
+from oscar.apps.shipping import methods
11
 from oscar.core.compat import get_user_model
12
 from oscar.core.compat import get_user_model
12
 from oscar.core.loading import get_class, get_classes, get_model
13
 from oscar.core.loading import get_class, get_classes, get_model
13
-from oscar.apps.shipping import methods
14
-from oscar.test.testcases import WebTestCase
15
 from oscar.test import factories
14
 from oscar.test import factories
15
+from oscar.test.testcases import WebTestCase
16
+
16
 from . import CheckoutMixin
17
 from . import CheckoutMixin
17
 
18
 
18
 GatewayForm = get_class('checkout.forms', 'GatewayForm')
19
 GatewayForm = get_class('checkout.forms', 'GatewayForm')

+ 3
- 4
tests/functional/customer/test_alert.py 查看文件

1
 from unittest import mock
1
 from unittest import mock
2
 
2
 
3
-from django_webtest import WebTest
4
-
5
 from django.contrib.auth.models import AnonymousUser
3
 from django.contrib.auth.models import AnonymousUser
6
-from django.urls import reverse
7
 from django.core import mail
4
 from django.core import mail
8
 from django.test import TestCase
5
 from django.test import TestCase
6
+from django.urls import reverse
7
+from django_webtest import WebTest
9
 
8
 
10
 from oscar.apps.customer.alerts.utils import (
9
 from oscar.apps.customer.alerts.utils import (
11
     send_alert_confirmation, send_product_alerts)
10
     send_alert_confirmation, send_product_alerts)
12
 from oscar.apps.customer.forms import ProductAlertForm
11
 from oscar.apps.customer.forms import ProductAlertForm
13
 from oscar.apps.customer.models import ProductAlert
12
 from oscar.apps.customer.models import ProductAlert
14
 from oscar.test.factories import (
13
 from oscar.test.factories import (
15
-    create_product, create_stockrecord, ProductAlertFactory, UserFactory)
14
+    ProductAlertFactory, UserFactory, create_product, create_stockrecord)
16
 
15
 
17
 
16
 
18
 class TestAUser(WebTest):
17
 class TestAUser(WebTest):

+ 2
- 3
tests/functional/customer/test_auth.py 查看文件

4
 from django.urls import reverse
4
 from django.urls import reverse
5
 from django_webtest import WebTest
5
 from django_webtest import WebTest
6
 
6
 
7
-from oscar.test.testcases import WebTestCase
8
-from oscar.test import factories
9
 from oscar.core.compat import get_user_model
7
 from oscar.core.compat import get_user_model
10
-
8
+from oscar.test import factories
9
+from oscar.test.testcases import WebTestCase
11
 
10
 
12
 User = get_user_model()
11
 User = get_user_model()
13
 
12
 

+ 0
- 1
tests/functional/customer/test_history.py 查看文件

10
 from oscar.test.factories import create_product
10
 from oscar.test.factories import create_product
11
 from oscar.test.testcases import WebTestCase
11
 from oscar.test.testcases import WebTestCase
12
 
12
 
13
-
14
 User = get_user_model()
13
 User = get_user_model()
15
 COOKIE_NAME = settings.OSCAR_RECENTLY_VIEWED_COOKIE_NAME
14
 COOKIE_NAME = settings.OSCAR_RECENTLY_VIEWED_COOKIE_NAME
16
 
15
 

+ 3
- 3
tests/functional/customer/test_notification.py 查看文件

1
 from http import client as http_client
1
 from http import client as http_client
2
 
2
 
3
-from oscar.test.testcases import WebTestCase
4
-from oscar.apps.customer.notifications import services
5
-from oscar.test.factories import UserFactory
6
 from django.urls import reverse
3
 from django.urls import reverse
7
 
4
 
8
 from oscar.apps.customer.models import Notification
5
 from oscar.apps.customer.models import Notification
6
+from oscar.apps.customer.notifications import services
7
+from oscar.test.factories import UserFactory
8
+from oscar.test.testcases import WebTestCase
9
 
9
 
10
 
10
 
11
 class TestAUserWithUnreadNotifications(WebTestCase):
11
 class TestAUserWithUnreadNotifications(WebTestCase):

+ 4
- 5
tests/functional/customer/test_profile.py 查看文件

3
 
3
 
4
 from django.urls import reverse
4
 from django.urls import reverse
5
 
5
 
6
-from oscar.test.factories import create_product, create_order
7
-from oscar.test.testcases import WebTestCase
8
-from oscar.core.compat import get_user_model
9
 from oscar.apps.basket.models import Basket
6
 from oscar.apps.basket.models import Basket
10
-from oscar.apps.partner import strategy
11
 from oscar.apps.order.models import Order
7
 from oscar.apps.order.models import Order
12
-
8
+from oscar.apps.partner import strategy
9
+from oscar.core.compat import get_user_model
10
+from oscar.test.factories import create_order, create_product
11
+from oscar.test.testcases import WebTestCase
13
 
12
 
14
 User = get_user_model()
13
 User = get_user_model()
15
 
14
 

+ 1
- 2
tests/functional/customer/test_wishlists.py 查看文件

2
 from django.urls import reverse_lazy
2
 from django.urls import reverse_lazy
3
 
3
 
4
 from oscar.core.loading import get_model
4
 from oscar.core.loading import get_model
5
-
6
-from oscar.test.factories import create_product, WishListFactory
5
+from oscar.test.factories import WishListFactory, create_product
7
 from oscar.test.testcases import WebTestCase
6
 from oscar.test.testcases import WebTestCase
8
 
7
 
9
 WishList = get_model('wishlists', 'WishList')
8
 WishList = get_model('wishlists', 'WishList')

+ 3
- 3
tests/functional/dashboard/test_catalogue.py 查看文件

1
 from http import client as http_client
1
 from http import client as http_client
2
+
2
 from django.urls import reverse
3
 from django.urls import reverse
3
 
4
 
4
 from oscar.core.loading import get_class, get_model
5
 from oscar.core.loading import get_class, get_model
5
 from oscar.test.factories import (
6
 from oscar.test.factories import (
6
-    CategoryFactory, PartnerFactory, ProductAttributeFactory,
7
-    ProductFactory, create_product)
7
+    CategoryFactory, PartnerFactory, ProductAttributeFactory, ProductFactory,
8
+    create_product)
8
 from oscar.test.testcases import WebTestCase, add_permissions
9
 from oscar.test.testcases import WebTestCase, add_permissions
9
 
10
 
10
-
11
 Product = get_model('catalogue', 'Product')
11
 Product = get_model('catalogue', 'Product')
12
 ProductClass = get_model('catalogue', 'ProductClass')
12
 ProductClass = get_model('catalogue', 'ProductClass')
13
 ProductCategory = get_model('catalogue', 'ProductCategory')
13
 ProductCategory = get_model('catalogue', 'ProductCategory')

+ 3
- 3
tests/functional/dashboard/test_catalogue_option.py 查看文件

6
 from oscar.test.factories import (
6
 from oscar.test.factories import (
7
     OptionFactory, ProductClassFactory, create_product)
7
     OptionFactory, ProductClassFactory, create_product)
8
 from oscar.test.testcases import WebTestCase
8
 from oscar.test.testcases import WebTestCase
9
-from .testcases import (
10
-    ListViewMixin, PopUpObjectCreateMixin,
11
-    PopUpObjectUpdateMixin, PopUpObjectDeleteMixin)
12
 
9
 
10
+from .testcases import (
11
+    ListViewMixin, PopUpObjectCreateMixin, PopUpObjectDeleteMixin,
12
+    PopUpObjectUpdateMixin)
13
 
13
 
14
 Option = get_model('catalogue', 'Option')
14
 Option = get_model('catalogue', 'Option')
15
 OptionForm = get_class('dashboard.catalogue.forms', 'OptionForm')
15
 OptionForm = get_class('dashboard.catalogue.forms', 'OptionForm')

+ 7
- 6
tests/functional/dashboard/test_catalogue_option_group.py 查看文件

1
 from django.contrib.messages import ERROR
1
 from django.contrib.messages import ERROR
2
 from django.utils.translation import gettext
2
 from django.utils.translation import gettext
3
+
3
 from oscar.core.loading import get_class, get_model
4
 from oscar.core.loading import get_class, get_model
4
-from oscar.test.testcases import WebTestCase
5
 from oscar.test.factories import (
5
 from oscar.test.factories import (
6
-    AttributeOptionFactory,
7
-    AttributeOptionGroupFactory, ProductAttributeFactory)
8
-from .testcases import (
9
-    ListViewMixin, PopUpObjectCreateMixin,
10
-    PopUpObjectUpdateMixin, PopUpObjectDeleteMixin)
6
+    AttributeOptionFactory, AttributeOptionGroupFactory,
7
+    ProductAttributeFactory)
8
+from oscar.test.testcases import WebTestCase
11
 
9
 
10
+from .testcases import (
11
+    ListViewMixin, PopUpObjectCreateMixin, PopUpObjectDeleteMixin,
12
+    PopUpObjectUpdateMixin)
12
 
13
 
13
 AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup')
14
 AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup')
14
 AttributeOption = get_model('catalogue', 'AttributeOption')
15
 AttributeOption = get_model('catalogue', 'AttributeOption')

+ 2
- 2
tests/functional/dashboard/test_category.py 查看文件

1
 from django.urls import reverse
1
 from django.urls import reverse
2
 
2
 
3
-from oscar.test.testcases import WebTestCase
4
-from oscar.apps.catalogue.models import Category
5
 from oscar.apps.catalogue.categories import create_from_breadcrumbs
3
 from oscar.apps.catalogue.categories import create_from_breadcrumbs
4
+from oscar.apps.catalogue.models import Category
6
 from oscar.test.factories import UserFactory
5
 from oscar.test.factories import UserFactory
6
+from oscar.test.testcases import WebTestCase
7
 
7
 
8
 
8
 
9
 class TestCategoryDashboard(WebTestCase):
9
 class TestCategoryDashboard(WebTestCase):

+ 4
- 3
tests/functional/dashboard/test_dashboard.py 查看文件

2
 
2
 
3
 from django.urls import reverse
3
 from django.urls import reverse
4
 
4
 
5
-from oscar.core import prices
6
-from oscar.core.loading import get_model
7
 from oscar.apps.dashboard.views import IndexView
5
 from oscar.apps.dashboard.views import IndexView
8
 from oscar.apps.order.models import Order
6
 from oscar.apps.order.models import Order
7
+from oscar.core import prices
8
+from oscar.core.loading import get_model
9
+from oscar.test.factories import (
10
+    UserFactory, create_basket, create_order, create_product)
9
 from oscar.test.testcases import WebTestCase
11
 from oscar.test.testcases import WebTestCase
10
-from oscar.test.factories import create_order, create_product, create_basket, UserFactory
11
 
12
 
12
 StockAlert = get_model('partner', 'StockAlert')
13
 StockAlert = get_model('partner', 'StockAlert')
13
 
14
 

+ 1
- 1
tests/functional/dashboard/test_offer.py 查看文件

1
 from django.urls import reverse
1
 from django.urls import reverse
2
 from django.utils import timezone
2
 from django.utils import timezone
3
 
3
 
4
-from oscar.test import testcases, factories
5
 from oscar.apps.offer import models
4
 from oscar.apps.offer import models
5
+from oscar.test import factories, testcases
6
 
6
 
7
 
7
 
8
 class TestAnAdmin(testcases.WebTestCase):
8
 class TestAnAdmin(testcases.WebTestCase):

+ 4
- 5
tests/functional/dashboard/test_order.py 查看文件

3
 from django.conf import settings
3
 from django.conf import settings
4
 from django.urls import reverse
4
 from django.urls import reverse
5
 
5
 
6
-from oscar.core.loading import get_model
7
 from oscar.apps.order.models import (
6
 from oscar.apps.order.models import (
8
     Order, OrderNote, PaymentEvent, PaymentEventType)
7
     Order, OrderNote, PaymentEvent, PaymentEventType)
9
-from oscar.test.factories import PartnerFactory, ShippingAddressFactory
10
-from oscar.test.factories import create_order, create_basket
8
+from oscar.core.loading import get_model
9
+from oscar.test.factories import (
10
+    PartnerFactory, ShippingAddressFactory, SourceTypeFactory,
11
+    create_basket, create_order)
11
 from oscar.test.testcases import WebTestCase
12
 from oscar.test.testcases import WebTestCase
12
-from oscar.test.factories import SourceTypeFactory
13
-
14
 
13
 
15
 Basket = get_model('basket', 'Basket')
14
 Basket = get_model('basket', 'Basket')
16
 Partner = get_model('partner', 'Partner')
15
 Partner = get_model('partner', 'Partner')

+ 1
- 1
tests/functional/dashboard/test_partner.py 查看文件

1
 from django.urls import reverse
1
 from django.urls import reverse
2
 
2
 
3
-from oscar.test.testcases import WebTestCase
4
 from oscar.apps.partner import models
3
 from oscar.apps.partner import models
4
+from oscar.test.testcases import WebTestCase
5
 
5
 
6
 
6
 
7
 class TestPartnerDashboard(WebTestCase):
7
 class TestPartnerDashboard(WebTestCase):

+ 8
- 9
tests/functional/dashboard/test_product.py 查看文件

2
 import os
2
 import os
3
 import posixpath
3
 import posixpath
4
 import shutil
4
 import shutil
5
-from PIL import Image
6
 
5
 
7
 from django.conf import settings
6
 from django.conf import settings
8
 from django.urls import reverse
7
 from django.urls import reverse
9
 from django.utils import timezone
8
 from django.utils import timezone
9
+from PIL import Image
10
+from six import BytesIO
11
+from webtest import Upload
10
 
12
 
11
-from oscar.test import factories
12
-from oscar.test.testcases import WebTestCase
13
+from oscar.apps.catalogue.models import Product, ProductAttribute
13
 from oscar.core.compat import get_user_model
14
 from oscar.core.compat import get_user_model
14
 from oscar.core.loading import get_model
15
 from oscar.core.loading import get_model
15
-from oscar.apps.catalogue.models import Product, ProductAttribute
16
+from oscar.test import factories
16
 from oscar.test.factories import (
17
 from oscar.test.factories import (
17
-    CategoryFactory, ProductFactory, ProductAttributeFactory,
18
-    ProductClassFactory)
19
-
20
-from six import BytesIO
21
-from webtest import Upload
18
+    CategoryFactory, ProductAttributeFactory, ProductClassFactory,
19
+    ProductFactory)
20
+from oscar.test.testcases import WebTestCase
22
 
21
 
23
 User = get_user_model()
22
 User = get_user_model()
24
 ProductImage = get_model('catalogue', 'ProductImage')
23
 ProductImage = get_model('catalogue', 'ProductImage')

+ 2
- 3
tests/functional/dashboard/test_range.py 查看文件

1
 from django.contrib.messages.constants import SUCCESS, WARNING
1
 from django.contrib.messages.constants import SUCCESS, WARNING
2
-from django.urls import reverse
3
 from django.test import TestCase
2
 from django.test import TestCase
3
+from django.urls import reverse
4
+from webtest.forms import Upload
4
 
5
 
5
 from oscar.apps.dashboard.ranges import forms
6
 from oscar.apps.dashboard.ranges import forms
6
 from oscar.apps.offer.models import Range, RangeProductFileUpload
7
 from oscar.apps.offer.models import Range, RangeProductFileUpload
7
 from oscar.test.factories import create_product
8
 from oscar.test.factories import create_product
8
 from oscar.test.testcases import WebTestCase
9
 from oscar.test.testcases import WebTestCase
9
 
10
 
10
-from webtest.forms import Upload
11
-
12
 
11
 
13
 class RangeProductFormTests(TestCase):
12
 class RangeProductFormTests(TestCase):
14
 
13
 

+ 0
- 1
tests/functional/dashboard/test_review.py 查看文件

8
 from oscar.test.factories import ProductReviewFactory, UserFactory
8
 from oscar.test.factories import ProductReviewFactory, UserFactory
9
 from oscar.test.testcases import WebTestCase
9
 from oscar.test.testcases import WebTestCase
10
 
10
 
11
-
12
 ProductReview = get_model('reviews', 'productreview')
11
 ProductReview = get_model('reviews', 'productreview')
13
 User = get_user_model()
12
 User = get_user_model()
14
 
13
 

+ 1
- 1
tests/functional/dashboard/test_shipping.py 查看文件

2
 
2
 
3
 from django.urls import reverse
3
 from django.urls import reverse
4
 
4
 
5
-from oscar.test.testcases import WebTestCase
6
 from oscar.apps.shipping import models
5
 from oscar.apps.shipping import models
6
+from oscar.test.testcases import WebTestCase
7
 
7
 
8
 
8
 
9
 class TestShippingMethodDashboard(WebTestCase):
9
 class TestShippingMethodDashboard(WebTestCase):

+ 1
- 2
tests/functional/dashboard/test_widgets.py 查看文件

1
 from django import forms
1
 from django import forms
2
 from django.test import TestCase, override_settings
2
 from django.test import TestCase, override_settings
3
 
3
 
4
-from oscar.test.factories import Member
5
-
6
 from oscar.apps.dashboard.widgets import RelatedFieldWidgetWrapper
4
 from oscar.apps.dashboard.widgets import RelatedFieldWidgetWrapper
5
+from oscar.test.factories import Member
7
 
6
 
8
 
7
 
9
 @override_settings(ROOT_URLCONF='oscar.test.factories.urls')
8
 @override_settings(ROOT_URLCONF='oscar.test.factories.urls')

+ 4
- 3
tests/functional/dashboard/testcases.py 查看文件

1
 import json
1
 import json
2
-from django.conf import settings
3
 from http import client as http_client
2
 from http import client as http_client
3
+
4
+from django.conf import settings
5
+from django.contrib.messages import INFO
4
 from django.urls import reverse
6
 from django.urls import reverse
5
 from django.utils.http import urlencode
7
 from django.utils.http import urlencode
6
-from django.contrib.messages import INFO
7
-from oscar.core.loading import get_class
8
 
8
 
9
+from oscar.core.loading import get_class
9
 
10
 
10
 RelatedFieldWidgetWrapper = get_class('dashboard.widgets',
11
 RelatedFieldWidgetWrapper = get_class('dashboard.widgets',
11
                                       'RelatedFieldWidgetWrapper')
12
                                       'RelatedFieldWidgetWrapper')

+ 1
- 2
tests/functional/test_basket.py 查看文件

1
-from decimal import Decimal as D
2
 import datetime
1
 import datetime
2
+from decimal import Decimal as D
3
 from http import client as http_client
3
 from http import client as http_client
4
 from http.cookies import _unquote
4
 from http.cookies import _unquote
5
 
5
 
17
 from oscar.test.factories import create_product
17
 from oscar.test.factories import create_product
18
 from oscar.test.testcases import WebTestCase
18
 from oscar.test.testcases import WebTestCase
19
 
19
 
20
-
21
 User = get_user_model()
20
 User = get_user_model()
22
 
21
 
23
 
22
 

+ 1
- 2
tests/functional/test_stock_alert.py 查看文件

3
 from django.test import TestCase
3
 from django.test import TestCase
4
 
4
 
5
 from oscar.apps.partner.models import StockAlert
5
 from oscar.apps.partner.models import StockAlert
6
-from oscar.test.basket import add_product
7
 from oscar.test import factories
6
 from oscar.test import factories
8
-
7
+from oscar.test.basket import add_product
9
 from tests._site.apps.partner.models import StockRecord
8
 from tests._site.apps.partner.models import StockRecord
10
 
9
 
11
 
10
 

+ 1
- 1
tests/integration/address/test_forms.py 查看文件

1
 from django.test import TestCase
1
 from django.test import TestCase
2
 
2
 
3
-from oscar.apps.address import models, forms
3
+from oscar.apps.address import forms, models
4
 from oscar.test.factories import UserFactory
4
 from oscar.test.factories import UserFactory
5
 
5
 
6
 
6
 

+ 3
- 5
tests/integration/address/test_models.py 查看文件

1
 # -*- coding: utf-8 -*-
1
 # -*- coding: utf-8 -*-
2
 import pytest
2
 import pytest
3
-from django.test import TestCase
4
 from django.core import exceptions
3
 from django.core import exceptions
4
+from django.test import TestCase
5
 
5
 
6
+from oscar.apps.address import models
6
 from oscar.apps.order.models import ShippingAddress
7
 from oscar.apps.order.models import ShippingAddress
7
 from oscar.core.compat import get_user_model
8
 from oscar.core.compat import get_user_model
8
-from oscar.apps.address import models
9
 from oscar.test import factories
9
 from oscar.test import factories
10
-
11
 from tests._site.model_tests_app.models import (
10
 from tests._site.model_tests_app.models import (
12
-    UserAddressModelWithCustomBaseFields, UserAddressModelWithCustomHashFields
13
-)
11
+    UserAddressModelWithCustomBaseFields, UserAddressModelWithCustomHashFields)
14
 
12
 
15
 User = get_user_model()
13
 User = get_user_model()
16
 
14
 

+ 1
- 2
tests/integration/basket/test_forms.py 查看文件

1
 from decimal import Decimal as D
1
 from decimal import Decimal as D
2
 from unittest import mock
2
 from unittest import mock
3
 
3
 
4
-from django.test import TestCase, override_settings
5
 from django.conf import settings
4
 from django.conf import settings
5
+from django.test import TestCase, override_settings
6
 
6
 
7
 from oscar.apps.basket import forms, formsets
7
 from oscar.apps.basket import forms, formsets
8
 from oscar.apps.offer.utils import Applicator
8
 from oscar.apps.offer.utils import Applicator
12
 from oscar.test.factories import (
12
 from oscar.test.factories import (
13
     BenefitFactory, ConditionalOfferFactory, ConditionFactory, RangeFactory)
13
     BenefitFactory, ConditionalOfferFactory, ConditionFactory, RangeFactory)
14
 
14
 
15
-
16
 Line = get_model('basket', 'Line')
15
 Line = get_model('basket', 'Line')
17
 
16
 
18
 
17
 

+ 1
- 1
tests/integration/basket/test_middleware.py 查看文件

1
+from django.contrib.auth.models import AnonymousUser
1
 from django.http import HttpResponse
2
 from django.http import HttpResponse
2
 from django.test import TestCase
3
 from django.test import TestCase
3
 from django.test.client import RequestFactory
4
 from django.test.client import RequestFactory
4
-from django.contrib.auth.models import AnonymousUser
5
 
5
 
6
 from oscar.apps.basket import middleware
6
 from oscar.apps.basket import middleware
7
 
7
 

+ 3
- 4
tests/integration/catalogue/reviews/test_models.py 查看文件

1
-from django.test import TestCase
2
 from django.core.exceptions import ValidationError
1
 from django.core.exceptions import ValidationError
2
+from django.test import TestCase
3
 
3
 
4
-from oscar.core.compat import get_user_model
5
 from oscar.apps.catalogue.reviews import models
4
 from oscar.apps.catalogue.reviews import models
6
-from oscar.test.factories import create_product
7
-from oscar.test.factories import UserFactory
5
+from oscar.core.compat import get_user_model
6
+from oscar.test.factories import UserFactory, create_product
8
 
7
 
9
 User = get_user_model()
8
 User = get_user_model()
10
 
9
 

+ 2
- 2
tests/integration/catalogue/test_attributes.py 查看文件

1
-from datetime import datetime, date
1
+from datetime import date, datetime
2
 
2
 
3
-from django.test import TestCase
4
 from django.core.exceptions import ValidationError
3
 from django.core.exceptions import ValidationError
5
 from django.core.files.uploadedfile import SimpleUploadedFile
4
 from django.core.files.uploadedfile import SimpleUploadedFile
5
+from django.test import TestCase
6
 
6
 
7
 from oscar.test import factories
7
 from oscar.test import factories
8
 
8
 

+ 1
- 1
tests/integration/catalogue/test_category.py 查看文件

3
 from django.test import TestCase
3
 from django.test import TestCase
4
 from django.test.utils import override_settings
4
 from django.test.utils import override_settings
5
 
5
 
6
-from oscar.apps.catalogue.models import Category
7
 from oscar.apps.catalogue.categories import create_from_breadcrumbs
6
 from oscar.apps.catalogue.categories import create_from_breadcrumbs
7
+from oscar.apps.catalogue.models import Category
8
 from oscar.templatetags.category_tags import get_annotated_list
8
 from oscar.templatetags.category_tags import get_annotated_list
9
 
9
 
10
 
10
 

+ 1
- 2
tests/integration/catalogue/test_options.py 查看文件

1
 from django.test import TestCase
1
 from django.test import TestCase
2
 
2
 
3
-from oscar.test import factories
4
 from oscar.core.loading import get_model
3
 from oscar.core.loading import get_model
5
-
4
+from oscar.test import factories
6
 
5
 
7
 Product = get_model('catalogue', 'Product')
6
 Product = get_model('catalogue', 'Product')
8
 
7
 

+ 4
- 5
tests/integration/catalogue/test_product.py 查看文件

1
 # coding=utf-8
1
 # coding=utf-8
2
+from django.core.exceptions import ValidationError
2
 from django.db import IntegrityError
3
 from django.db import IntegrityError
3
 from django.test import TestCase
4
 from django.test import TestCase
4
-from django.core.exceptions import ValidationError
5
 
5
 
6
-from oscar.apps.catalogue.models import (Product, ProductClass,
7
-                                         ProductAttribute,
8
-                                         AttributeOption,
9
-                                         ProductRecommendation)
6
+from oscar.apps.catalogue.models import (
7
+    AttributeOption, Product, ProductAttribute,
8
+    ProductClass, ProductRecommendation)
10
 from oscar.test import factories
9
 from oscar.test import factories
11
 
10
 
12
 
11
 

+ 1
- 2
tests/integration/catalogue/test_product_search_handler_setting.py 查看文件

2
 from django.test.utils import override_settings
2
 from django.test.utils import override_settings
3
 
3
 
4
 from oscar.apps.catalogue.search_handlers import (
4
 from oscar.apps.catalogue.search_handlers import (
5
-    get_product_search_handler_class,
6
-)
5
+    get_product_search_handler_class)
7
 
6
 
8
 
7
 
9
 class TestSearchHandler(object):
8
 class TestSearchHandler(object):

+ 3
- 3
tests/integration/checkout/test_mixins.py 查看文件

6
 from django.test.utils import override_settings
6
 from django.test.utils import override_settings
7
 
7
 
8
 from oscar.apps.checkout.calculators import OrderTotalCalculator
8
 from oscar.apps.checkout.calculators import OrderTotalCalculator
9
-from oscar.apps.checkout.mixins import CheckoutSessionMixin, OrderPlacementMixin
10
 from oscar.apps.checkout.exceptions import FailedPreCondition
9
 from oscar.apps.checkout.exceptions import FailedPreCondition
10
+from oscar.apps.checkout.mixins import (
11
+    CheckoutSessionMixin, OrderPlacementMixin)
12
+from oscar.apps.shipping.methods import FixedPrice, Free
11
 from oscar.core.loading import get_model
13
 from oscar.core.loading import get_model
12
 from oscar.test import factories
14
 from oscar.test import factories
13
 from oscar.test.basket import add_product
15
 from oscar.test.basket import add_product
14
 from oscar.test.utils import RequestFactory
16
 from oscar.test.utils import RequestFactory
15
-from oscar.apps.shipping.methods import FixedPrice, Free
16
-
17
 
17
 
18
 Order = get_model('order', 'Order')
18
 Order = get_model('order', 'Order')
19
 
19
 

+ 1
- 1
tests/integration/checkout/test_session.py 查看文件

1
 from unittest import mock
1
 from unittest import mock
2
 
2
 
3
+from django.contrib.sessions.middleware import SessionMiddleware
3
 from django.test import TestCase
4
 from django.test import TestCase
4
 from django.test.client import RequestFactory
5
 from django.test.client import RequestFactory
5
-from django.contrib.sessions.middleware import SessionMiddleware
6
 
6
 
7
 from oscar.apps.checkout.utils import CheckoutSessionData
7
 from oscar.apps.checkout.utils import CheckoutSessionData
8
 
8
 

+ 1
- 1
tests/integration/core/test_compat.py 查看文件

4
 import io
4
 import io
5
 import os
5
 import os
6
 from tempfile import NamedTemporaryFile
6
 from tempfile import NamedTemporaryFile
7
-from django.utils.encoding import smart_text
8
 
7
 
9
 from django.test import TestCase, override_settings
8
 from django.test import TestCase, override_settings
9
+from django.utils.encoding import smart_text
10
 
10
 
11
 from oscar.core.compat import UnicodeCSVWriter, existing_user_fields
11
 from oscar.core.compat import UnicodeCSVWriter, existing_user_fields
12
 
12
 

+ 1
- 2
tests/integration/core/test_customisation.py 查看文件

1
 import os
1
 import os
2
-from os.path import exists, join
3
 import sys
2
 import sys
4
 import tempfile
3
 import tempfile
4
+from os.path import exists, join
5
 
5
 
6
 import pytest
6
 import pytest
7
-
8
 from django.conf import settings
7
 from django.conf import settings
9
 from django.test import TestCase, override_settings
8
 from django.test import TestCase, override_settings
10
 
9
 

+ 4
- 4
tests/integration/core/test_loading.py 查看文件

1
-from os.path import dirname
2
 import sys
1
 import sys
2
+from os.path import dirname
3
 
3
 
4
 from django.apps import AppConfig, apps
4
 from django.apps import AppConfig, apps
5
-from django.test import override_settings, TestCase
6
 from django.conf import settings
5
 from django.conf import settings
6
+from django.test import TestCase, override_settings
7
 
7
 
8
 from oscar.core.loading import (
8
 from oscar.core.loading import (
9
-    get_model, AppNotFoundError, get_classes, get_class, get_class_loader,
10
-    ClassNotFoundError)
9
+    AppNotFoundError, ClassNotFoundError, get_class, get_class_loader,
10
+    get_classes, get_model)
11
 from tests import temporary_python_path
11
 from tests import temporary_python_path
12
 from tests._site.loader import DummyClass
12
 from tests._site.loader import DummyClass
13
 
13
 

+ 1
- 0
tests/integration/core/test_prices.py 查看文件

1
 from decimal import Decimal as D
1
 from decimal import Decimal as D
2
 from itertools import product
2
 from itertools import product
3
+
3
 from django.test import TestCase
4
 from django.test import TestCase
4
 
5
 
5
 from oscar.core.prices import Price
6
 from oscar.core.prices import Price

+ 3
- 2
tests/integration/core/test_validator.py 查看文件

1
-from django.core.exceptions import ValidationError
2
 from django.contrib.flatpages.models import FlatPage
1
 from django.contrib.flatpages.models import FlatPage
2
+from django.core.exceptions import ValidationError
3
 from django.test import TestCase, override_settings
3
 from django.test import TestCase, override_settings
4
 from django.utils.translation import activate
4
 from django.utils.translation import activate
5
 
5
 
6
-from oscar.core.validators import ExtendedURLValidator, URLDoesNotExistValidator
6
+from oscar.core.validators import (
7
+    ExtendedURLValidator, URLDoesNotExistValidator)
7
 
8
 
8
 
9
 
9
 class TestExtendedURLValidator(TestCase):
10
 class TestExtendedURLValidator(TestCase):

+ 1
- 3
tests/integration/customer/test_alert.py 查看文件

2
 
2
 
3
 from oscar.apps.customer.models import ProductAlert
3
 from oscar.apps.customer.models import ProductAlert
4
 from oscar.core.compat import get_user_model
4
 from oscar.core.compat import get_user_model
5
-from oscar.test.factories import create_product
6
-from oscar.test.factories import UserFactory
7
-
5
+from oscar.test.factories import UserFactory, create_product
8
 
6
 
9
 User = get_user_model()
7
 User = get_user_model()
10
 
8
 

+ 1
- 2
tests/integration/customer/test_customer.py 查看文件

1
 from django.test import TestCase
1
 from django.test import TestCase
2
 
2
 
3
-from oscar.core.compat import get_user_model
4
 from oscar.apps.customer.models import CommunicationEventType
3
 from oscar.apps.customer.models import CommunicationEventType
5
-
4
+from oscar.core.compat import get_user_model
6
 
5
 
7
 User = get_user_model()
6
 User = get_user_model()
8
 
7
 

+ 3
- 4
tests/integration/customer/test_dispatcher.py 查看文件

1
 from django.core import mail
1
 from django.core import mail
2
 from django.test import TestCase
2
 from django.test import TestCase
3
 
3
 
4
-from oscar.core.compat import get_user_model
5
-from oscar.apps.customer.utils import Dispatcher, get_password_reset_url
6
 from oscar.apps.customer.models import CommunicationEventType, Email
4
 from oscar.apps.customer.models import CommunicationEventType, Email
5
+from oscar.apps.customer.utils import Dispatcher, get_password_reset_url
7
 from oscar.apps.order.models import CommunicationEvent
6
 from oscar.apps.order.models import CommunicationEvent
8
-from oscar.test.factories import create_order, SiteFactory
9
-
7
+from oscar.core.compat import get_user_model
8
+from oscar.test.factories import SiteFactory, create_order
10
 
9
 
11
 User = get_user_model()
10
 User = get_user_model()
12
 
11
 

+ 1
- 1
tests/integration/customer/test_history.py 查看文件

1
-from django.test import TestCase
2
 from django import http
1
 from django import http
2
+from django.test import TestCase
3
 
3
 
4
 from oscar.apps.customer import history
4
 from oscar.apps.customer import history
5
 
5
 

+ 1
- 2
tests/integration/customer/test_utils.py 查看文件

1
 from django.test import TestCase
1
 from django.test import TestCase
2
 
2
 
3
-from oscar.core.compat import get_user_model
4
 from oscar.apps.customer.utils import get_password_reset_url, normalise_email
3
 from oscar.apps.customer.utils import get_password_reset_url, normalise_email
5
-
4
+from oscar.core.compat import get_user_model
6
 
5
 
7
 User = get_user_model()
6
 User = get_user_model()
8
 
7
 

+ 2
- 2
tests/integration/dashboard/test_offer_forms.py 查看文件

2
 
2
 
3
 from django.core.exceptions import ValidationError
3
 from django.core.exceptions import ValidationError
4
 from django.test import TestCase
4
 from django.test import TestCase
5
+
5
 from oscar.apps.dashboard.offers import forms
6
 from oscar.apps.dashboard.offers import forms
6
 from oscar.apps.offer.custom import create_benefit
7
 from oscar.apps.offer.custom import create_benefit
7
-from oscar.apps.offer.models import Range, Benefit
8
+from oscar.apps.offer.models import Benefit, Range
8
 from oscar.test.factories import create_product
9
 from oscar.test.factories import create_product
9
-
10
 from tests._site.model_tests_app.models import CustomBenefitModel
10
 from tests._site.model_tests_app.models import CustomBenefitModel
11
 
11
 
12
 
12
 

+ 0
- 1
tests/integration/dashboard/test_reviews.py 查看文件

8
 from oscar.test.factories.catalogue import ProductReviewFactory
8
 from oscar.test.factories.catalogue import ProductReviewFactory
9
 from oscar.test.factories.customer import UserFactory
9
 from oscar.test.factories.customer import UserFactory
10
 
10
 
11
-
12
 now = timezone.now()
11
 now = timezone.now()
13
 
12
 
14
 
13
 

+ 3
- 2
tests/integration/dashboard/test_voucher_form.py 查看文件

1
-from django import test
2
 from datetime import timedelta
1
 from datetime import timedelta
3
-from django.utils import timezone
2
+
4
 import pytest
3
 import pytest
4
+from django import test
5
+from django.utils import timezone
5
 
6
 
6
 from oscar.apps.dashboard.vouchers import forms
7
 from oscar.apps.dashboard.vouchers import forms
7
 from oscar.test.factories.offer import RangeFactory
8
 from oscar.test.factories.offer import RangeFactory

+ 2
- 1
tests/integration/forms/test_field.py 查看文件

1
-from oscar.forms import fields
2
 from django.test import TestCase
1
 from django.test import TestCase
3
 
2
 
3
+from oscar.forms import fields
4
+
4
 
5
 
5
 class TestExtendedURLField(TestCase):
6
 class TestExtendedURLField(TestCase):
6
     """ExtendedURLField"""
7
     """ExtendedURLField"""

+ 1
- 1
tests/integration/offer/test_absolute_benefit.py 查看文件

6
 
6
 
7
 from oscar.apps.offer import models
7
 from oscar.apps.offer import models
8
 from oscar.apps.offer.utils import Applicator
8
 from oscar.apps.offer.utils import Applicator
9
-from oscar.test.basket import add_product, add_products
10
 from oscar.test import factories
9
 from oscar.test import factories
10
+from oscar.test.basket import add_product, add_products
11
 
11
 
12
 
12
 
13
 class TestAnAbsoluteDiscountAppliedWithCountConditionOnDifferentRange(TestCase):
13
 class TestAnAbsoluteDiscountAppliedWithCountConditionOnDifferentRange(TestCase):

+ 3
- 4
tests/integration/offer/test_applicator.py 查看文件

6
 from oscar.apps.offer import models
6
 from oscar.apps.offer import models
7
 from oscar.apps.offer.results import OfferApplications
7
 from oscar.apps.offer.results import OfferApplications
8
 from oscar.apps.offer.utils import Applicator
8
 from oscar.apps.offer.utils import Applicator
9
-from oscar.test.factories import (
10
-    BasketFactory, RangeFactory, BenefitFactory, ConditionFactory,
11
-    ConditionalOfferFactory)
12
-
13
 from oscar.test.basket import add_product
9
 from oscar.test.basket import add_product
10
+from oscar.test.factories import (
11
+    BasketFactory, BenefitFactory, ConditionalOfferFactory, ConditionFactory,
12
+    RangeFactory)
14
 
13
 
15
 
14
 
16
 class TestOfferApplicator(TestCase):
15
 class TestOfferApplicator(TestCase):

+ 1
- 1
tests/integration/offer/test_benefit.py 查看文件

1
-from decimal import Decimal, ROUND_DOWN
1
+from decimal import ROUND_DOWN, Decimal
2
 from unittest.mock import patch
2
 from unittest.mock import patch
3
 
3
 
4
 import pytest
4
 import pytest

+ 1
- 1
tests/integration/offer/test_combination.py 查看文件

3
 from django.test import TestCase
3
 from django.test import TestCase
4
 
4
 
5
 from oscar.apps.offer import models
5
 from oscar.apps.offer import models
6
-from oscar.test.basket import add_product, add_products
7
 from oscar.test import factories
6
 from oscar.test import factories
7
+from oscar.test.basket import add_product, add_products
8
 
8
 
9
 
9
 
10
 class TestACountConditionWithPercentageDiscount(TestCase):
10
 class TestACountConditionWithPercentageDiscount(TestCase):

+ 1
- 2
tests/integration/offer/test_condition.py 查看文件

1
-import pytest
2
 from decimal import Decimal as D
1
 from decimal import Decimal as D
3
 from unittest import mock
2
 from unittest import mock
4
 
3
 
4
+import pytest
5
 from django.test import TestCase
5
 from django.test import TestCase
6
 
6
 
7
 from oscar.apps.basket.models import Basket
7
 from oscar.apps.basket.models import Basket
8
 from oscar.apps.offer import custom, models
8
 from oscar.apps.offer import custom, models
9
 from oscar.test import factories
9
 from oscar.test import factories
10
 from oscar.test.basket import add_product
10
 from oscar.test.basket import add_product
11
-
12
 from tests._site.model_tests_app.models import BasketOwnerCalledBarry
11
 from tests._site.model_tests_app.models import BasketOwnerCalledBarry
13
 
12
 
14
 
13
 

+ 2
- 3
tests/integration/offer/test_conditionaloffer_delete.py 查看文件

2
 
2
 
3
 from oscar.apps.offer import custom, models
3
 from oscar.apps.offer import custom, models
4
 from oscar.test import factories
4
 from oscar.test import factories
5
-
6
-from tests._site.model_tests_app.models import (BasketOwnerCalledBarry,
7
-                                                CustomBenefitModel)
5
+from tests._site.model_tests_app.models import (
6
+    BasketOwnerCalledBarry, CustomBenefitModel)
8
 
7
 
9
 
8
 
10
 class TestConditionalOfferDelete(TestCase):
9
 class TestConditionalOfferDelete(TestCase):

+ 2
- 1
tests/integration/offer/test_custom.py 查看文件

2
 
2
 
3
 from oscar.apps.offer import custom
3
 from oscar.apps.offer import custom
4
 from tests._site.model_tests_app.models import (
4
 from tests._site.model_tests_app.models import (
5
-    CustomBenefitModel, CustomBenefitWithoutName, CustomConditionModel, CustomConditionWithoutName)
5
+    CustomBenefitModel, CustomBenefitWithoutName, CustomConditionModel,
6
+    CustomConditionWithoutName)
6
 
7
 
7
 
8
 
8
 class TestCustomBenefit(TestCase):
9
 class TestCustomBenefit(TestCase):

+ 1
- 1
tests/integration/offer/test_custom_range.py 查看文件

1
 from django.core.exceptions import ValidationError
1
 from django.core.exceptions import ValidationError
2
 from django.test import TestCase
2
 from django.test import TestCase
3
-from oscar.test.factories import create_product
4
 from django.utils.translation import gettext_lazy as _
3
 from django.utils.translation import gettext_lazy as _
5
 
4
 
6
 from oscar.apps.offer import custom
5
 from oscar.apps.offer import custom
6
+from oscar.test.factories import create_product
7
 
7
 
8
 
8
 
9
 class CustomRange(object):
9
 class CustomRange(object):

+ 1
- 1
tests/integration/offer/test_manager.py 查看文件

3
 from django.test import TestCase
3
 from django.test import TestCase
4
 from django.utils import timezone
4
 from django.utils import timezone
5
 
5
 
6
-from oscar.test import factories
7
 from oscar.apps.offer import models
6
 from oscar.apps.offer import models
7
+from oscar.test import factories
8
 
8
 
9
 
9
 
10
 class TestActiveOfferManager(TestCase):
10
 class TestActiveOfferManager(TestCase):

+ 1
- 1
tests/integration/offer/test_multibuy_benefit.py 查看文件

5
 from django.test import TestCase
5
 from django.test import TestCase
6
 
6
 
7
 from oscar.apps.offer import models
7
 from oscar.apps.offer import models
8
-from oscar.test.basket import add_product, add_products
9
 from oscar.test import factories
8
 from oscar.test import factories
9
+from oscar.test.basket import add_product, add_products
10
 
10
 
11
 
11
 
12
 class TestAMultibuyDiscountAppliedWithCountCondition(TestCase):
12
 class TestAMultibuyDiscountAppliedWithCountCondition(TestCase):

+ 0
- 0
tests/integration/offer/test_post_order_action.py 查看文件


部分文件因为文件数量过多而无法显示

正在加载...
取消
保存