diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4706322..85a9d78 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,11 +23,12 @@ jobs: strategy: matrix: python-version: - # - "3.6" stopped working with GitHub actions, disabling temporarily - "3.7" - "3.8" - "3.9" - "3.10" + - "3.11" + - "3.12" fail-fast: false services: @@ -58,7 +59,7 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip wheel setuptools tox + python -m pip install --upgrade pip wheel tox - name: Run tox targets for ${{ matrix.python-version }} run: | ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") diff --git a/README.md b/README.md index 1a50653..e4c7f9b 100644 --- a/README.md +++ b/README.md @@ -411,6 +411,7 @@ You may need to do this if you use a custom user model and upgrade Django. * added tolerance to the ending slash in URL * ReferralResponse now stores http_referrer +* Updated testing. Tests now passes in Django 2.2-5.1 and Python 3.7-3.12 ### 4.2.0 (2023-01-12) diff --git a/pinax/referrals/tests/test_models.py b/pinax/referrals/tests/test_models.py index e230b11..f0c6d46 100644 --- a/pinax/referrals/tests/test_models.py +++ b/pinax/referrals/tests/test_models.py @@ -19,8 +19,8 @@ def test_referral_responses_for_request_no_user(self): # Create a referral with a blank user request = RequestFactory().get("/referral/") request.session = self.client.session - baker.make("ReferralResponse", session_key=request.session.session_key) - baker.make("ReferralResponse", user=baker.make("User")) + baker.make("ReferralResponse", session_key=request.session.session_key, target=None, referral__target=None) + baker.make("ReferralResponse", user=baker.make("User"), target=None, referral__target=None) queryset = Referral.referral_responses_for_request(request) self.assertEqual(queryset.count(), 1) self.assertEqual(queryset.get().session_key, request.session.session_key) @@ -31,8 +31,8 @@ def test_referral_responses_for_request_user(self): request = RequestFactory().get("/referral/") request.session = self.client.session request.user = baker.make("User") - baker.make("ReferralResponse", user=request.user, session_key="foo_bar") - baker.make("ReferralResponse", session_key="session_key") + baker.make("ReferralResponse", user=request.user, session_key="foo_bar", target=None, referral__target=None) + baker.make("ReferralResponse", session_key="session_key", target=None, referral__target=None) queryset = Referral.referral_responses_for_request(request) self.assertEqual(queryset.count(), 1) self.assertEqual(queryset.get().user, request.user) @@ -41,7 +41,7 @@ def test_referral_responses_for_request_user(self): @override_settings(PINAX_REFERRALS_CODE_GENERATOR_CALLBACK=generate_code_callback) def test_code_generator_callback(self): user = baker.make("User", username="joe") - referral = baker.make("Referral", user=user, code=None) + referral = baker.make("Referral", user=user, code=None, target=None) # the callback function is being called in the save() method, inside baker.make self.assertEqual(referral.code, "recommended-by-joe") @@ -49,6 +49,6 @@ def test_code_generator_callback(self): def test_legacy_code_generator_callback(self): # the new callback signature accepts two parameters, but the old callback signature # with just the referral_class as parameter should still work - referral = baker.make("Referral", code=None) + referral = baker.make("Referral", code=None, target=None) # the callback function is being called in the save() method, inside baker.make self.assertEqual(referral.code, "some-generated-code") diff --git a/tox.ini b/tox.ini index ade13f0..0245d25 100644 --- a/tox.ini +++ b/tox.ini @@ -28,19 +28,27 @@ show_missing = True [tox] envlist = checkqa, - py{36,37,38,39}-dj{22,30,31}, - py{38,39,310}-dj{32,40,41,main} + py{37,38,39}-dj{22,30,31}, + py{37,38,39,310}-dj{32} + py{38,39,310}-dj{32,40} + py{38,39,310,311}-dj{41} + py{38,39,310,311,312}-dj{42} + py{310,311,312}-dj{50,51,main} [testenv] passenv = CI, CIRCLECI, CIRCLE_* deps = coverage<5 + setuptools dj22: Django>=2.2,<3.0 dj30: Django>=3.0,<3.1 dj31: Django>=3.1,<3.2 dj32: Django>=3.2,<4.0 dj40: Django>=4.0,<4.1 dj41: Django>=4.1,<4.2 + dj42: Django>=4.2,<5.0 + dj50: Django>=5.0,<5.1 + dj51: Django>=5.1a1,<5.2 master: https://github.com/django/django/tarball/master -r requirements_test.txt