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

Commit

Permalink
fix: get_response issue for middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
mumarkhan999 committed Dec 22, 2023
1 parent 78d3735 commit 4333351
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ecommerce/extensions/analytics/tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TrackingMiddlewareTests(TestCase):

def setUp(self):
super(TrackingMiddlewareTests, self).setUp()
self.middleware = middleware.TrackingMiddleware()
self.middleware = middleware.TrackingMiddleware(get_response=lambda request: None)
self.request_factory = RequestFactory()
self.user = self.create_user()

Expand Down
4 changes: 2 additions & 2 deletions ecommerce/extensions/catalogue/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def is_executive_education_2u_product(self):
CertificateType.UNPAID_EXECUTIVE_EDUCATION
]

def save(self, *args, **kwargs):
super(Product, self).save(*args, **kwargs) # pylint: disable=bad-super-call
def clean(self):
super().clean()
try:
if not isinstance(self.attr.note, str) and self.attr.note is not None:
log_message_and_raise_validation_error(
Expand Down
4 changes: 2 additions & 2 deletions ecommerce/extensions/partner/apps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


from oscar.apps.partner.apps import PartnerConfig as CorePartnerConfig
from oscar.apps.partner import apps


class PartnerConfig(CorePartnerConfig):
class PartnerConfig(apps.PartnerConfig):
name = 'ecommerce.extensions.partner'
2 changes: 1 addition & 1 deletion ecommerce/extensions/payment/core/tests/test_sdn.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def test_sdn_is_down_sdn_fallback_called(
If there is no hit, allow purchase.
"""
request = RequestFactory().post('/payment/cybersource/submit/')
middleware = SessionMiddleware()
middleware = SessionMiddleware(get_response=lambda request: None)
middleware.process_request(request)
request.session.save()
site_configuration = self.site.siteconfiguration
Expand Down

0 comments on commit 4333351

Please sign in to comment.