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 django.conf import settings
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.test import Client, TestCase
|
||||
|
@ -59,9 +60,8 @@ class CSVExportAccessTest(MessagePatch, TestCase):
|
|||
def test_anonymous(self):
|
||||
client = Client()
|
||||
r = client.get(self.url)
|
||||
self.assertRedirects(
|
||||
r, "/login?next={}".format(self.url), fetch_redirect_response=False
|
||||
)
|
||||
login_url = "{}?next={}".format(reverse(settings.LOGIN_URL), self.url)
|
||||
self.assertRedirects(r, login_url, fetch_redirect_response=False)
|
||||
|
||||
def test_unauthorised(self):
|
||||
client = Client()
|
||||
|
|
Loading…
Reference in a new issue