Test obsolescence des comptes
This commit is contained in:
parent
5f49ecf270
commit
da3ce8f464
3 changed files with 16 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
from allauth.socialaccount.models import SocialAccount
|
from allauth.socialaccount.models import SocialAccount
|
||||||
from allauth_cas.test.testcases import CASTestCase
|
from allauth_cas.test.testcases import CASTestCase
|
||||||
|
from allauth_ens.adapter import deprecate_clippers
|
||||||
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
|
@ -307,7 +308,18 @@ class ArchicubeViewsTest(ExperiENSTestCase):
|
||||||
# TODO : test post()
|
# TODO : test post()
|
||||||
|
|
||||||
|
|
||||||
|
class DeprecatedArchicubeViewsTest(ArchicubeViewsTest):
|
||||||
|
def setUp(self):
|
||||||
|
super().setUp()
|
||||||
|
|
||||||
|
self.sa_archi = SocialAccount(user=self.u_archi,
|
||||||
|
provider="clipper",
|
||||||
|
uid="archicube")
|
||||||
|
self.sa_archi.save()
|
||||||
|
|
||||||
|
deprecate_clippers()
|
||||||
|
|
||||||
|
self.client.login(username='archicube', password='archicube')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -373,6 +385,8 @@ class ScolariteViewsTest(ExperiENSTestCase):
|
||||||
kwargs={'username': self.u_conscrit.username})
|
kwargs={'username': self.u_conscrit.username})
|
||||||
r = self.client.get(testurl)
|
r = self.client.get(testurl)
|
||||||
self.assertEqual(r.status_code, 200)
|
self.assertEqual(r.status_code, 200)
|
||||||
|
self.assertContains(r, "Wingardium Leviosa") # Public
|
||||||
|
self.assertNotContains(r, "Avada Kedavra") # Brouillon
|
||||||
|
|
||||||
testurl = reverse('avisstage:profil',
|
testurl = reverse('avisstage:profil',
|
||||||
kwargs={'username': self.u_archi.username})
|
kwargs={'username': self.u_archi.username})
|
||||||
|
|
|
@ -140,7 +140,7 @@ def manage_stage(request, pk=None):
|
||||||
avis_stage_form.instance.stage = stage
|
avis_stage_form.instance.stage = stage
|
||||||
avis_stage_form.save()
|
avis_stage_form.save()
|
||||||
avis_lieu_formset.save()
|
avis_lieu_formset.save()
|
||||||
print(request.POST)
|
#print(request.POST)
|
||||||
if "continuer" in request.POST:
|
if "continuer" in request.POST:
|
||||||
if pk is None:
|
if pk is None:
|
||||||
return redirect(reverse('avisstage:stage_edit',kwargs={'pk':stage.id}))
|
return redirect(reverse('avisstage:stage_edit',kwargs={'pk':stage.id}))
|
||||||
|
@ -168,7 +168,7 @@ def save_lieu(request):
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
pk = request.POST.get("id", None)
|
pk = request.POST.get("id", None)
|
||||||
print(request.POST)
|
#print(request.POST)
|
||||||
jitter = False
|
jitter = False
|
||||||
if pk is None or pk == '':
|
if pk is None or pk == '':
|
||||||
lieu = Lieu()
|
lieu = Lieu()
|
||||||
|
|
|
@ -176,7 +176,6 @@ def recherche_resultats(request):
|
||||||
tri = cached["tri"]
|
tri = cached["tri"]
|
||||||
logger.info("recherche en cache")
|
logger.info("recherche en cache")
|
||||||
|
|
||||||
print(stageids)
|
|
||||||
# Pagination
|
# Pagination
|
||||||
paginator = Paginator(stageids, 25)
|
paginator = Paginator(stageids, 25)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue