Skip to content

Commit

Permalink
Merge pull request #71 from dabapps/django-4.1
Browse files Browse the repository at this point in the history
Add Django 4.1 and Python 3.11 to test matrix, remove Django 2.2 and Python 3.6
  • Loading branch information
j4mie authored Jan 21, 2023
2 parents f6ef96f + e2fec32 commit f4ac9c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ jobs:

strategy:
matrix:
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
django: ["2.2", "3.2", "4.0"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
django: ["3.2", "4.0", "4.1"]
exclude:
- python: "3.6"
django: "4.0"
- python: "3.7"
django: "4.0"
- python: "3.10"
django: "2.2"
- python: "3.6"
django: "4.1"
- python: "3.7"
django: "4.1"

steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 7 additions & 0 deletions log_request_id/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from log_request_id import DEFAULT_NO_REQUEST_ID, local
from log_request_id.middleware import RequestIDMiddleware
from testproject.views import test_view, test_async_view
from unittest import mock


class RequestIDLoggingTestCase(TestCase):
Expand All @@ -30,6 +31,12 @@ def setUp(self):
except AttributeError:
pass

@mock.patch("log_request_id.middleware.RequestIDMiddleware._generate_id")
def test_request(self, mock_generate_id):
mock_generate_id.return_value = "test_id"
self.client.get(self.url)
self.assertTrue("test_id" in self.handler.messages[0])

def test_id_generation(self):
request = self.factory.get(self.url)
middleware = RequestIDMiddleware(get_response=lambda request: None)
Expand Down

0 comments on commit f4ac9c7

Please sign in to comment.