Procházet zdrojové kódy

Reduce maximum line length in flake8 config to 119 characters.

master
Samir Shah před 6 roky
rodič
revize
349ae18be2

+ 1
- 1
setup.cfg Zobrazit soubor

@@ -9,7 +9,7 @@ filterwarnings =
9 9
 exclude = migrations
10 10
 ignore = F405,W503,E731
11 11
 max-complexity = 10
12
-max-line-length=159
12
+max-line-length=119
13 13
 
14 14
 [isort]
15 15
 line_length = 79

+ 4
- 2
src/oscar/apps/dashboard/views.py Zobrazit soubor

@@ -201,13 +201,15 @@ class PopUpWindowCreateUpdateMixin(object):
201 201
     def get_context_data(self, **kwargs):
202 202
         ctx = super().get_context_data(**kwargs)
203 203
 
204
-        if RelatedFieldWidgetWrapper.TO_FIELD_VAR in self.request.GET or RelatedFieldWidgetWrapper.TO_FIELD_VAR in self.request.POST:
204
+        if (RelatedFieldWidgetWrapper.TO_FIELD_VAR in self.request.GET or
205
+                RelatedFieldWidgetWrapper.TO_FIELD_VAR in self.request.POST):
205 206
             to_field = self.request.GET.get(RelatedFieldWidgetWrapper.TO_FIELD_VAR,
206 207
                                             self.request.POST.get(RelatedFieldWidgetWrapper.TO_FIELD_VAR))
207 208
             ctx['to_field'] = to_field
208 209
             ctx['to_field_var'] = RelatedFieldWidgetWrapper.TO_FIELD_VAR
209 210
 
210
-        if RelatedFieldWidgetWrapper.IS_POPUP_VAR in self.request.GET or RelatedFieldWidgetWrapper.IS_POPUP_VAR in self.request.POST:
211
+        if (RelatedFieldWidgetWrapper.IS_POPUP_VAR in self.request.GET or
212
+                RelatedFieldWidgetWrapper.IS_POPUP_VAR in self.request.POST):
211 213
             is_popup = self.request.GET.get(RelatedFieldWidgetWrapper.IS_POPUP_VAR,
212 214
                                             self.request.POST.get(RelatedFieldWidgetWrapper.IS_POPUP_VAR))
213 215
             ctx['is_popup'] = is_popup

+ 7
- 3
tests/functional/dashboard/test_catalogue.py Zobrazit soubor

@@ -353,7 +353,9 @@ class AttributeOptionGroupUpdateMixin(object):
353 353
         self.assertEqual(response.context['form'].instance, self.attribute_option_group)
354 354
         self.assertInContext(response, 'attribute_option_formset')
355 355
         self.assertIsInstance(response.context['attribute_option_formset'], AttributeOptionFormSet)
356
-        self.assertEqual(response.context['attribute_option_formset'].initial_forms[0].instance, self.attribute_option_group.options.first())
356
+        self.assertEqual(
357
+            response.context['attribute_option_formset'].initial_forms[0].instance,
358
+            self.attribute_option_group.options.first())
357 359
         self.assertInContext(response, 'title')
358 360
         self.assertEqual(response.context['title'], self.title)
359 361
 
@@ -708,7 +710,8 @@ class TestAttributeOptionGroupDeleteView(AttributeOptionGroupDeleteMixin,
708 710
         self._set_up_display_delete_form_disallowed_vars()
709 711
         self._set_up_pop_up_window_vars()
710 712
 
711
-        ProductAttributeFactory(type='multi_option', name='Sizes', code='sizes', option_group=self.attribute_option_group)
713
+        ProductAttributeFactory(
714
+            type='multi_option', name='Sizes', code='sizes', option_group=self.attribute_option_group)
712 715
 
713 716
         params = {
714 717
             self.is_popup_var: self.is_popup,
@@ -736,7 +739,8 @@ class TestAttributeOptionGroupDeleteView(AttributeOptionGroupDeleteMixin,
736 739
         self._set_up_display_delete_form_vars()
737 740
         self._set_up_display_delete_form_disallowed_vars()
738 741
 
739
-        ProductAttributeFactory(type='multi_option', name='Sizes', code='sizes', option_group=self.attribute_option_group)
742
+        ProductAttributeFactory(
743
+            type='multi_option', name='Sizes', code='sizes', option_group=self.attribute_option_group)
740 744
 
741 745
         self.response = self.get(self.url)
742 746
 

+ 2
- 1
tests/integration/core/test_loading.py Zobrazit soubor

@@ -224,7 +224,8 @@ class TestMovedClasses(TestCase):
224 224
         self.assertTrue(isinstance(LineFormset(instance=self.wishlist).forms[0], WishListLineForm))
225 225
 
226 226
     def test_load_formsets_mixed_destination(self):
227
-        BaseBasketLineFormSet, BasketLineForm = get_classes('basket.forms', ('BaseBasketLineFormSet', 'BasketLineForm'))
227
+        BaseBasketLineFormSet, BasketLineForm = get_classes(
228
+            'basket.forms', ('BaseBasketLineFormSet', 'BasketLineForm'))
228 229
         self.assertEqual('oscar.apps.basket.formsets', BaseBasketLineFormSet.__module__)
229 230
         self.assertEqual('oscar.apps.basket.forms', BasketLineForm.__module__)
230 231
         StockRecordForm, StockRecordFormSet = get_classes(

+ 1
- 1
tests/integration/offer/test_absolute_benefit.py Zobrazit soubor

@@ -136,7 +136,7 @@ class TestAnAbsoluteDiscountAppliedWithCountCondition(TestCase):
136 136
         self.assertEqual(4, self.basket.num_items_with_discount)
137 137
         self.assertEqual(0, self.basket.num_items_without_discount)
138 138
 
139
-    def test_applies_correctly_to_basket_which_exceeds_condition_with_smaller_prices_than_discount_and_higher_prices_first(self):
139
+    def test_applies_basket_exceeding_condition_smaller_prices_than_discount_higher_prices_first(self):
140 140
         add_products(self.basket, [
141 141
             (D('2.00'), 2), (D('4.00'), 2)])
142 142
         result = self.benefit.apply(self.basket, self.condition, self.offer)

Načítá se…
Zrušit
Uložit