Revision b08aadc0 snf-astakos-app/astakos/im/tests/auth.py
b/snf-astakos-app/astakos/im/tests/auth.py | ||
---|---|---|
384 | 384 |
@im_settings(RECAPTCHA_ENABLED=True, RATELIMIT_RETRIES_ALLOWED=3) |
385 | 385 |
def test_login_ratelimit(self): |
386 | 386 |
from django.core.cache import cache |
387 |
cache.clear()
|
|
387 |
[cache.delete(key) for key in cache._cache.keys()]
|
|
388 | 388 |
|
389 | 389 |
credentials = {'username': 'γιού τι έφ', 'password': 'password'} |
390 | 390 |
r = self.client.post(ui_url('local'), credentials, follow=True) |
... | ... | |
396 | 396 |
r = self.client.post(ui_url('local'), credentials, follow=True) |
397 | 397 |
fields = r.context['login_form'].fields.keyOrder |
398 | 398 |
self.assertTrue('recaptcha_challenge_field' in fields) |
399 |
r = self.client.post(ui_url('local'), follow=True) |
|
400 |
fields = r.context['login_form'].fields.keyOrder |
|
401 |
self.assertTrue('recaptcha_challenge_field' in fields) |
|
402 | 399 |
|
403 | 400 |
def test_no_moderation(self): |
404 | 401 |
# disable moderation |
... | ... | |
820 | 817 |
|
821 | 818 |
# new academic user |
822 | 819 |
self.assertFalse(academic_users.filter(email='newuser@synnefo.org')) |
823 |
cl_newuser.set_tokens(eppn="newusereppn", mail="newuser@synnefo.org",
|
|
820 |
cl_newuser.set_tokens(remote_user="newusereppn", mail="newuser@synnefo.org",
|
|
824 | 821 |
surname="Lastname") |
825 | 822 |
r = cl_newuser.get(ui_url('login/shibboleth?'), follow=True) |
826 | 823 |
initial = r.context['signup_form'].initial |
Also available in: Unified diff