forked from DGNum/gestioCOF
Make events tests independent of LOGIN_URL
This commit is contained in:
parent
25b603d667
commit
3a34ab4462
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.contrib.auth.models import Permission
|
from django.contrib.auth.models import Permission
|
||||||
from django.test import Client, TestCase
|
from django.test import Client, TestCase
|
||||||
|
@ -59,9 +60,8 @@ class CSVExportAccessTest(MessagePatch, TestCase):
|
||||||
def test_anonymous(self):
|
def test_anonymous(self):
|
||||||
client = Client()
|
client = Client()
|
||||||
r = client.get(self.url)
|
r = client.get(self.url)
|
||||||
self.assertRedirects(
|
login_url = "{}?next={}".format(reverse(settings.LOGIN_URL), self.url)
|
||||||
r, "/login?next={}".format(self.url), fetch_redirect_response=False
|
self.assertRedirects(r, login_url, fetch_redirect_response=False)
|
||||||
)
|
|
||||||
|
|
||||||
def test_unauthorised(self):
|
def test_unauthorised(self):
|
||||||
client = Client()
|
client = Client()
|
||||||
|
|
Loading…
Reference in a new issue