Skip to content

Commit

Permalink
added tests for django v4.
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa-mahmoud authored and Mostafa M. Mohamed committed Sep 12, 2022
1 parent 86aa8b9 commit 4841e97
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Dockerfile.temp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM python:3.5-stretch
FROM python:3.5-alpine
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN apk add build-base libc-dev gcc python3-dev jpeg-dev zlib-dev
RUN chown -R root:root /usr/local/lib/python*
RUN pip3 install --no-cache --pre Django==2.2 pillow
COPY djenerator/ /tmp/djenerator
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ The following combinations are tested:
| 2.2.28 | 3.7 ||
| 3.2.15 | 3.6 ||
| 3.2.15 | 3.7 ||
| 4.0.7 | 3.8 ||
| 4.0.7 | 3.9 ||
| 4.1.1 | 3.8 ||
| 4.1.1 | 3.9 ||

## Requirements

Expand Down
10 changes: 7 additions & 3 deletions djenerator/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ def get_timezone(tz: str):
try:
import zoneinfo
return zoneinfo.ZoneInfo(tz)
except Exception:
import pytz
return pytz.timezone(tz)
except ImportError:
try:
from backports import zoneinfo
return zoneinfo.ZoneInfo(tz)
except Exception:
import pytz
return pytz.timezone(tz)
8 changes: 8 additions & 0 deletions test-all-versions
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,12 @@ cat Dockerfile.temp | sed "s/3.5/3.6/" | sed "s/2.2/3.2.15/" > Dockerfile && ma
head -n 1 Dockerfile && head -n 5 Dockerfile | tail -n 1 && echo -e "\n\n"
cat Dockerfile.temp | sed "s/3.5/3.7/" | sed "s/2.2/3.2.15/" > Dockerfile && make docker-test
head -n 1 Dockerfile && head -n 5 Dockerfile | tail -n 1 && echo -e "\n\n"
cat Dockerfile.temp | sed "s/3.5/3.8/" | sed "s/2.2/4.0.7/" > Dockerfile && make docker-test
head -n 1 Dockerfile && head -n 5 Dockerfile | tail -n 1 && echo -e "\n\n"
cat Dockerfile.temp | sed "s/3.5/3.8/" | sed "s/2.2/4.1.1/" > Dockerfile && make docker-test
head -n 1 Dockerfile && head -n 5 Dockerfile | tail -n 1 && echo -e "\n\n"
cat Dockerfile.temp | sed "s/3.5/3.9/" | sed "s/2.2/4.0.7/" > Dockerfile && make docker-test
head -n 1 Dockerfile && head -n 5 Dockerfile | tail -n 1 && echo -e "\n\n"
cat Dockerfile.temp | sed "s/3.5/3.9/" | sed "s/2.2/4.1.1/" > Dockerfile && make docker-test
head -n 1 Dockerfile && head -n 5 Dockerfile | tail -n 1 && echo -e "\n\n"
rm Dockerfile

0 comments on commit 4841e97

Please sign in to comment.