mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-18 04:02:35 +03:00
GitHub Actions: Run tests_with_pytz_installed
This commit is contained in:
parent
f4194c4684
commit
f7c431bc0c
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
|
@ -12,6 +12,7 @@ jobs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
- '3.6'
|
- '3.6'
|
||||||
|
|
|
@ -75,11 +75,9 @@ from rest_framework.response import Response
|
||||||
|
|
||||||
@cache_page(60 * 15)
|
@cache_page(60 * 15)
|
||||||
@vary_on_cookie
|
@vary_on_cookie
|
||||||
@api_view(['GET'])
|
@api_view(["GET"])
|
||||||
def get_user_list(request):
|
def get_user_list(request):
|
||||||
content = {
|
content = {"user_feed": request.user.get_user_feed()}
|
||||||
'user_feed': request.user.get_user_feed()
|
|
||||||
}
|
|
||||||
return Response(content)
|
return Response(content)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
pytest>=7.0.1,<8.0
|
pytest>=7.0.1,<8.0
|
||||||
pytest-cov>=4.0.0,<5.0
|
pytest-cov>=4.0.0,<5.0
|
||||||
pytest-django>=4.5.2,<5.0
|
pytest-django>=4.5.2,<5.0
|
||||||
|
pytz
|
||||||
importlib-metadata<5.0
|
importlib-metadata<5.0
|
||||||
# temporary pin of attrs
|
# temporary pin of attrs
|
||||||
attrs==22.1.0
|
attrs==22.1.0
|
||||||
|
|
|
@ -9,6 +9,7 @@ from enum import auto
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from django import VERSION as DJANGO_VERSION
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import pytz
|
import pytz
|
||||||
|
@ -672,6 +673,7 @@ class FieldValues:
|
||||||
assert self.field.run_validation(input_value) == expected_output, \
|
assert self.field.run_validation(input_value) == expected_output, \
|
||||||
'input value: {}'.format(repr(input_value))
|
'input value: {}'.format(repr(input_value))
|
||||||
|
|
||||||
|
@pytest.mark.xfail(pytz and DJANGO_VERSION >= (5, 0), reason="Django v5 drops support for pytz")
|
||||||
def test_invalid_inputs(self, *args):
|
def test_invalid_inputs(self, *args):
|
||||||
"""
|
"""
|
||||||
Ensure that invalid values raise the expected validation error.
|
Ensure that invalid values raise the expected validation error.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user