mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-16 19:22:24 +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
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- '3.6'
|
||||
|
|
|
@ -75,11 +75,9 @@ from rest_framework.response import Response
|
|||
|
||||
@cache_page(60 * 15)
|
||||
@vary_on_cookie
|
||||
@api_view(['GET'])
|
||||
@api_view(["GET"])
|
||||
def get_user_list(request):
|
||||
content = {
|
||||
'user_feed': request.user.get_user_feed()
|
||||
}
|
||||
content = {"user_feed": request.user.get_user_feed()}
|
||||
return Response(content)
|
||||
```
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pytest>=7.0.1,<8.0
|
||||
pytest-cov>=4.0.0,<5.0
|
||||
pytest-django>=4.5.2,<5.0
|
||||
pytz
|
||||
importlib-metadata<5.0
|
||||
# temporary pin of attrs
|
||||
attrs==22.1.0
|
||||
|
|
|
@ -9,6 +9,7 @@ from enum import auto
|
|||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from django import VERSION as DJANGO_VERSION
|
||||
|
||||
try:
|
||||
import pytz
|
||||
|
@ -672,6 +673,7 @@ class FieldValues:
|
|||
assert self.field.run_validation(input_value) == expected_output, \
|
||||
'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):
|
||||
"""
|
||||
Ensure that invalid values raise the expected validation error.
|
||||
|
|
Loading…
Reference in New Issue
Block a user