瀏覽代碼

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,4 +17,4 @@ multi_line_output = 4
17 17
 balanced_wrapping = true
18 18
 known_first_party = oscar,tests
19 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,7 +2,6 @@ from django.utils.translation import gettext_lazy as _
2 2
 
3 3
 from oscar.core.loading import get_class, get_model
4 4
 
5
-
6 5
 ReportGenerator = get_class('dashboard.reports.reports', 'ReportGenerator')
7 6
 ReportCSVFormatter = get_class('dashboard.reports.reports',
8 7
                                'ReportCSVFormatter')

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

@@ -16,8 +16,9 @@ from django.urls import reverse
16 16
 from django.utils.functional import cached_property
17 17
 from django.utils.html import strip_tags
18 18
 from django.utils.safestring import mark_safe
19
+from django.utils.translation import get_language
19 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 22
 from treebeard.mp_tree import MP_Node
22 23
 
23 24
 from oscar.core.loading import get_class, get_model

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

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

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

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

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

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

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

@@ -13,8 +13,7 @@ from django.utils.translation import gettext_lazy as _
13 13
 from django.utils.translation import pgettext_lazy
14 14
 
15 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 17
 from oscar.core.loading import get_class, get_model, get_profile_class
19 18
 from oscar.forms import widgets
20 19
 

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

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

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

@@ -9,7 +9,6 @@ from django.utils.encoding import force_bytes
9 9
 from oscar.core.compat import urlsafe_base64_encode
10 10
 from oscar.core.loading import get_model
11 11
 
12
-
13 12
 CommunicationEvent = get_model('order', 'CommunicationEvent')
14 13
 Email = get_model('customer', 'Email')
15 14
 

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

@@ -3,7 +3,7 @@ from django.core import exceptions
3 3
 from django.utils.translation import gettext_lazy as _
4 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 7
 from oscar.core.utils import slugify
8 8
 from oscar.forms.widgets import DateTimePickerInput, ImageInput
9 9
 

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

@@ -12,7 +12,6 @@ from django_tables2 import SingleTableMixin, SingleTableView
12 12
 from oscar.core.loading import get_classes, get_model
13 13
 from oscar.views.generic import ObjectLookupView
14 14
 
15
-
16 15
 (ProductForm,
17 16
  ProductClassSelectForm,
18 17
  ProductSearchForm,

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

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

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

@@ -1,8 +1,7 @@
1 1
 from django import forms
2 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 6
 ProductReview = get_model('reviews', 'productreview')
8 7
 DatePickerInput = get_class('oscar.forms.widgets', 'DatePickerInput')

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

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

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

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

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

@@ -1,16 +1,16 @@
1 1
 import operator
2 2
 import os
3 3
 import re
4
-from decimal import Decimal as D
5 4
 from decimal import ROUND_DOWN
5
+from decimal import Decimal as D
6 6
 
7 7
 from django.conf import settings
8 8
 from django.core import exceptions
9 9
 from django.db import models
10
-from django.db.models.lookups import StartsWith
10
+from django.db.models import Exists, OuterRef
11 11
 from django.db.models.fields import Field
12
+from django.db.models.lookups import StartsWith
12 13
 from django.db.models.query import Q
13
-from django.db.models import OuterRef, Exists
14 14
 from django.template.defaultfilters import date as date_filter
15 15
 from django.urls import reverse
16 16
 from django.utils.functional import cached_property
@@ -19,7 +19,8 @@ from django.utils.translation import gettext_lazy as _
19 19
 
20 20
 from oscar.core.compat import AUTH_USER_MODEL
21 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 24
 from oscar.models import fields
24 25
 from oscar.templatetags.currency_filters import currency
25 26
 

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

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

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

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

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

@@ -1,5 +1,5 @@
1 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 5
 def product_class_as_queryset(product):

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

@@ -25,7 +25,6 @@ from oscar.utils.deprecation import RemovedInOscar21Warning
25 25
 
26 26
 from . import exceptions
27 27
 
28
-
29 28
 logger = logging.getLogger('oscar.order')
30 29
 
31 30
 

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

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

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

@@ -3,11 +3,11 @@ import csv
3 3
 from django.conf import settings
4 4
 from django.contrib.auth.models import User
5 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 9
 from oscar.core.loading import get_model
9 10
 
10
-
11 11
 # A setting that can be used in foreign key declarations
12 12
 AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
13 13
 try:

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

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

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

@@ -4,8 +4,10 @@ from django.conf.urls.i18n import is_language_prefix_patterns_used
4 4
 from django.core import validators
5 5
 from django.core.exceptions import ValidationError
6 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 12
 from oscar.core.loading import get_model
11 13
 

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

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

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

@@ -1,6 +1,6 @@
1 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 5
 register = template.Library()
6 6
 

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

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

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

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

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

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

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

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

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

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

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

@@ -1,4 +1,5 @@
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 5
 class AccountSummaryView(OscarAccountSummaryView):

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

@@ -8,4 +8,4 @@ class StockRecord(abstract_models.AbstractStockRecord):
8 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,10 +2,10 @@
2 2
 
3 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 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 10
 from oscar.apps.customer.abstract_models import AbstractUser
11 11
 

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

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

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

@@ -1,6 +1,6 @@
1
-from oscar.test.testcases import WebTestCase
2
-from oscar.test import factories
3 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 6
 class TestAddingToBasket(WebTestCase):

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

@@ -1,8 +1,9 @@
1 1
 from django.urls import reverse
2
-from oscar.test.testcases import WebTestCase
3
-from oscar.test.factories import create_product, UserFactory
2
+
4 3
 from oscar.apps.catalogue.reviews.signals import review_added
5 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 9
 class TestACustomer(WebTestCase):

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

@@ -2,7 +2,7 @@ from decimal import Decimal as D
2 2
 
3 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 6
 from oscar.test import factories
7 7
 
8 8
 UserAddress = get_model('address', 'UserAddress')

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

@@ -3,9 +3,10 @@ from unittest.mock import patch
3 3
 
4 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 7
 from oscar.test import factories
8 8
 from oscar.test.testcases import WebTestCase
9
+
9 10
 from . import CheckoutMixin
10 11
 
11 12
 Order = get_model('order', 'Order')

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

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

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

@@ -1,18 +1,17 @@
1 1
 from unittest import mock
2 2
 
3
-from django_webtest import WebTest
4
-
5 3
 from django.contrib.auth.models import AnonymousUser
6
-from django.urls import reverse
7 4
 from django.core import mail
8 5
 from django.test import TestCase
6
+from django.urls import reverse
7
+from django_webtest import WebTest
9 8
 
10 9
 from oscar.apps.customer.alerts.utils import (
11 10
     send_alert_confirmation, send_product_alerts)
12 11
 from oscar.apps.customer.forms import ProductAlertForm
13 12
 from oscar.apps.customer.models import ProductAlert
14 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 17
 class TestAUser(WebTest):

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

@@ -4,10 +4,9 @@ from django.core import mail
4 4
 from django.urls import reverse
5 5
 from django_webtest import WebTest
6 6
 
7
-from oscar.test.testcases import WebTestCase
8
-from oscar.test import factories
9 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 11
 User = get_user_model()
13 12
 

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

@@ -10,7 +10,6 @@ from oscar.templatetags.history_tags import get_back_button
10 10
 from oscar.test.factories import create_product
11 11
 from oscar.test.testcases import WebTestCase
12 12
 
13
-
14 13
 User = get_user_model()
15 14
 COOKIE_NAME = settings.OSCAR_RECENTLY_VIEWED_COOKIE_NAME
16 15
 

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

@@ -1,11 +1,11 @@
1 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 3
 from django.urls import reverse
7 4
 
8 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 11
 class TestAUserWithUnreadNotifications(WebTestCase):

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

@@ -3,13 +3,12 @@ from unittest.mock import patch
3 3
 
4 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 6
 from oscar.apps.basket.models import Basket
10
-from oscar.apps.partner import strategy
11 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 13
 User = get_user_model()
15 14
 

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

@@ -2,8 +2,7 @@
2 2
 from django.urls import reverse_lazy
3 3
 
4 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 6
 from oscar.test.testcases import WebTestCase
8 7
 
9 8
 WishList = get_model('wishlists', 'WishList')

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

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

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

@@ -6,10 +6,10 @@ from oscar.core.loading import get_class, get_model
6 6
 from oscar.test.factories import (
7 7
     OptionFactory, ProductClassFactory, create_product)
8 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 14
 Option = get_model('catalogue', 'Option')
15 15
 OptionForm = get_class('dashboard.catalogue.forms', 'OptionForm')

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

@@ -1,14 +1,15 @@
1 1
 from django.contrib.messages import ERROR
2 2
 from django.utils.translation import gettext
3
+
3 4
 from oscar.core.loading import get_class, get_model
4
-from oscar.test.testcases import WebTestCase
5 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 14
 AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup')
14 15
 AttributeOption = get_model('catalogue', 'AttributeOption')

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

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

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

@@ -2,12 +2,13 @@ from decimal import Decimal as D
2 2
 
3 3
 from django.urls import reverse
4 4
 
5
-from oscar.core import prices
6
-from oscar.core.loading import get_model
7 5
 from oscar.apps.dashboard.views import IndexView
8 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 11
 from oscar.test.testcases import WebTestCase
10
-from oscar.test.factories import create_order, create_product, create_basket, UserFactory
11 12
 
12 13
 StockAlert = get_model('partner', 'StockAlert')
13 14
 

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

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

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

@@ -3,14 +3,13 @@ from http import client as http_client
3 3
 from django.conf import settings
4 4
 from django.urls import reverse
5 5
 
6
-from oscar.core.loading import get_model
7 6
 from oscar.apps.order.models import (
8 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 12
 from oscar.test.testcases import WebTestCase
12
-from oscar.test.factories import SourceTypeFactory
13
-
14 13
 
15 14
 Basket = get_model('basket', 'Basket')
16 15
 Partner = get_model('partner', 'Partner')

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

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

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

@@ -2,23 +2,22 @@ import datetime
2 2
 import os
3 3
 import posixpath
4 4
 import shutil
5
-from PIL import Image
6 5
 
7 6
 from django.conf import settings
8 7
 from django.urls import reverse
9 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 14
 from oscar.core.compat import get_user_model
14 15
 from oscar.core.loading import get_model
15
-from oscar.apps.catalogue.models import Product, ProductAttribute
16
+from oscar.test import factories
16 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 22
 User = get_user_model()
24 23
 ProductImage = get_model('catalogue', 'ProductImage')

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

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

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

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

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

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

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

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

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

@@ -1,11 +1,12 @@
1 1
 import json
2
-from django.conf import settings
3 2
 from http import client as http_client
3
+
4
+from django.conf import settings
5
+from django.contrib.messages import INFO
4 6
 from django.urls import reverse
5 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 11
 RelatedFieldWidgetWrapper = get_class('dashboard.widgets',
11 12
                                       'RelatedFieldWidgetWrapper')

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

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

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

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

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

@@ -1,6 +1,6 @@
1 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 4
 from oscar.test.factories import UserFactory
5 5
 
6 6
 

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

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

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

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

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

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

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

@@ -1,10 +1,9 @@
1
-from django.test import TestCase
2 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 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 8
 User = get_user_model()
10 9
 

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

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

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

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

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

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

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

@@ -1,12 +1,11 @@
1 1
 # coding=utf-8
2
+from django.core.exceptions import ValidationError
2 3
 from django.db import IntegrityError
3 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 9
 from oscar.test import factories
11 10
 
12 11
 

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

@@ -2,8 +2,7 @@ from django.test import TestCase
2 2
 from django.test.utils import override_settings
3 3
 
4 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 8
 class TestSearchHandler(object):

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

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

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

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

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

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

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

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

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

@@ -1,13 +1,13 @@
1
-from os.path import dirname
2 1
 import sys
2
+from os.path import dirname
3 3
 
4 4
 from django.apps import AppConfig, apps
5
-from django.test import override_settings, TestCase
6 5
 from django.conf import settings
6
+from django.test import TestCase, override_settings
7 7
 
8 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 11
 from tests import temporary_python_path
12 12
 from tests._site.loader import DummyClass
13 13
 

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

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

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

@@ -1,9 +1,10 @@
1
-from django.core.exceptions import ValidationError
2 1
 from django.contrib.flatpages.models import FlatPage
2
+from django.core.exceptions import ValidationError
3 3
 from django.test import TestCase, override_settings
4 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 10
 class TestExtendedURLValidator(TestCase):

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

@@ -2,9 +2,7 @@ from django.test import TestCase
2 2
 
3 3
 from oscar.apps.customer.models import ProductAlert
4 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 7
 User = get_user_model()
10 8
 

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

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

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

@@ -1,12 +1,11 @@
1 1
 from django.core import mail
2 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 4
 from oscar.apps.customer.models import CommunicationEventType, Email
5
+from oscar.apps.customer.utils import Dispatcher, get_password_reset_url
7 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 10
 User = get_user_model()
12 11
 

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

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

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

@@ -1,8 +1,7 @@
1 1
 from django.test import TestCase
2 2
 
3
-from oscar.core.compat import get_user_model
4 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 6
 User = get_user_model()
8 7
 

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

@@ -2,11 +2,11 @@ from decimal import Decimal as D
2 2
 
3 3
 from django.core.exceptions import ValidationError
4 4
 from django.test import TestCase
5
+
5 6
 from oscar.apps.dashboard.offers import forms
6 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 9
 from oscar.test.factories import create_product
9
-
10 10
 from tests._site.model_tests_app.models import CustomBenefitModel
11 11
 
12 12
 

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

@@ -8,7 +8,6 @@ from oscar.core.loading import get_model
8 8
 from oscar.test.factories.catalogue import ProductReviewFactory
9 9
 from oscar.test.factories.customer import UserFactory
10 10
 
11
-
12 11
 now = timezone.now()
13 12
 
14 13
 

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

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

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

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

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

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

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

@@ -6,11 +6,10 @@ from django.test import TestCase
6 6
 from oscar.apps.offer import models
7 7
 from oscar.apps.offer.results import OfferApplications
8 8
 from oscar.apps.offer.utils import Applicator
9
-from oscar.test.factories import (
10
-    BasketFactory, RangeFactory, BenefitFactory, ConditionFactory,
11
-    ConditionalOfferFactory)
12
-
13 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 15
 class TestOfferApplicator(TestCase):

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

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

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

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

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

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

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

@@ -2,9 +2,8 @@ from django.test import TestCase
2 2
 
3 3
 from oscar.apps.offer import custom, models
4 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 9
 class TestConditionalOfferDelete(TestCase):

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

@@ -2,7 +2,8 @@ from django.test import TestCase
2 2
 
3 3
 from oscar.apps.offer import custom
4 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 9
 class TestCustomBenefit(TestCase):

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

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

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

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

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

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

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


部分文件因文件數量過多而無法顯示

Loading…
取消
儲存