Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-66: Update django to 4.1 #226

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions http_stubs/tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from http_stubs.models import AbstractHTTPStub, AbstractLogEntry
from http_stubs.models import HTTPStub, LogEntry


class TestAbstractHTTPStub:
"""Tests for AbstractHTTPStub class."""
"""Tests for AbstractHTTPStub class through HTTPStub."""

model = AbstractHTTPStub(
model = HTTPStub(
method='test_method',
path='test_path',
)
Expand All @@ -15,9 +15,9 @@ def test_str(self):


class TestAbstractLogEntry:
"""Tests for AbstractHTTPStub class."""
"""Tests for AbstractHTTPStub class through LogEntry."""

model = AbstractLogEntry()
model = LogEntry()

def test_str(self):
"""Test magic method __str__."""
Expand Down
10 changes: 5 additions & 5 deletions http_stubs/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_exist_not_regexp_stub(
if method != HTTPMethod.HEAD.name:
assert response.content == b'[]'
assert response.status_code == HTTPStatus.OK
assert response._headers['content-type'][1] == 'application/json'
assert response.headers['content-type'] == 'application/json'

@pytest.mark.freeze_time('2020-05-25')
def test_write_log(self, http_stub_factory, client):
Expand Down Expand Up @@ -132,9 +132,9 @@ def test_exist_regexp_stub(self, method: str, http_stub_factory, client):
if method != HTTPMethod.HEAD.name:
assert response.content == resp_body.encode('utf-8')
assert response.status_code == resp_status
assert response._headers['content-type'][1] == resp_content_type
assert response.headers['content-type'] == resp_content_type
for header_name, header_value in resp_headers.items():
assert response._headers[header_name.lower()][1] == header_value
assert response.headers[header_name.lower()] == header_value

@pytest.mark.parametrize(
'regexp, path, status_code', (
Expand Down Expand Up @@ -236,7 +236,7 @@ def test_proxy_httpstub_executor(

assert response.status_code == fake_response.status_code
assert response.content == fake_response.content
assert response._headers['test_response_header'][1] == '1'
assert response.headers['test_response_header'] == '1'

assert log.http_stub_id == stub.pk
assert log.path == 'http://127.0.0.1/test_request_path'
Expand Down Expand Up @@ -276,7 +276,7 @@ def test_response_templating(self, http_stub_factory, client):

assert response.status_code == HTTPStatus.OK
assert response.content == exp_string
assert response._headers['test'][1] == exp_string.decode()
assert response.headers['test'] == exp_string.decode()


@pytest.mark.parametrize(
Expand Down
33 changes: 21 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ django_settings_module = "kesha.settings"

[tool.poetry.dependencies]
python = "~3.10"
django = "~3.1"
django = "~4.1"
django-simpleui = "~2022.7"
uvicorn = "~0.18.2"
psycopg2-binary = "~2.9.3"
django-environ = "^0.9.0"
django-extensions = "^3.1.5"
django-debug-toolbar = "^3.2.4"
django-extensions = "^3.2.0"
django-debug-toolbar = "^3.5.0"
celery = { extras = ["redis"], version = "^5.2.7" }
RestrictedPython = "~5.2"
requests = "^2.28.1"
Expand Down