Skip to content

Commit

Permalink
Fix Tests to support Python3.12 and Django 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalioby committed Jan 5, 2024
1 parent f193fd6 commit 310b4f4
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions example/test_app/tests/test_current_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
class TestCurrentPlatform(TestCase):
def setUp(self) -> None:
self.request_factory = RequestFactory()
if not getattr(self, "assertEquals", None):
self.assertEquals = self.assertEqual

def check_platform(self,user_agent, platform):
request = self.request_factory.get('/', HTTP_USER_AGENT=user_agent)
Expand Down
2 changes: 2 additions & 0 deletions example/test_app/tests/test_fido.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def get_server_name(request):

class test_fido(TransactionTestCase):
def setUp(self) -> None:
if not getattr(self,"assertEquals",None):
self.assertEquals = self.assertEqual
from django.contrib.auth import get_user_model
self.user_model = get_user_model()
if self.user_model.objects.filter(username="test").count()==0:
Expand Down
3 changes: 3 additions & 0 deletions example/test_app/tests/test_passkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
class test_passkeys(TransactionTestCase):
def setUp(self) -> None:
from django.contrib.auth import get_user_model
if not getattr(self, "assertEquals", None):
self.assertEquals = self.assertEqual

self.user_model = get_user_model()
self.user = self.user_model.objects.create_user(username="test",password="test")
self.client = Client()
Expand Down
3 changes: 3 additions & 0 deletions example/test_app/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class test_views(TransactionTestCase):

def setUp(self) -> None:
from django.contrib.auth import get_user_model
if not getattr(self, "assertEquals", None):
self.assertEquals = self.assertEqual

self.user_model = get_user_model()
#self.user = self.user_model.objects.create_user(username="test", password="test")
self.client = Client()
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[tox]
envlist=
docs,
#docs,
py37-django{20,21,22,32},
py38-django{22,32,40,41,42},
py39-django{22,32,40,41,42},
py310-django{22,32,40,41,42},
py310-django{22,32,40,41,42,50},
py311-django{22,32,40,41,42,50},
py312-django{41,42,50},


[testenv]
Expand All @@ -17,7 +18,7 @@ deps =
django40: django>=4.0,<4.1
django41: django>=4.1,<4.2
django42: django>=4.2,<4.3
django50: django==5.0b1
django50: django>=5.0,<5.1
ua-parser
user-agents
django-sslserver
Expand Down

0 comments on commit 310b4f4

Please sign in to comment.