Projet

Général

Profil

0002-tests-only-check-for-is_authenticated-is_anonymous-a.patch

Nicolas Roche, 27 février 2020 09:24

Télécharger (1,53 ko)

Voir les différences:

Subject: [PATCH 2/3] tests: only check for is_authenticated/is_anonymous as
 attributes (#40099)

 tests_authentic/test_rest_authentication.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests_authentic/test_rest_authentication.py
42 42

  
43 43
        publik_authentication = rest_authentication.PublikAuthentication()
44 44
        result = publik_authentication.authenticate(request)
45 45
        assert result is not None
46 46
        assert isinstance(result, tuple)
47 47
        assert len(result) == 2
48 48
        assert result[0].__class__ is rest_authentication.AnonymousAdminServiceUser
49 49
        assert result[0].is_authenticated
50
        assert result[0].is_authenticated()
50
        assert result[0].is_authenticated
51
        assert result[0].is_anonymous
51 52
        assert result[0].is_anonymous
52
        assert result[0].is_anonymous()
53 53
        assert result[0].is_staff
54 54
        assert result[1] is None
55 55

  
56 56
        # Test user named after service orig
57 57
        service_user = User.objects.create(username=ORIG)
58 58

  
59 59
        AUTH_QUERY = '&orig=%s' % urllib.quote(ORIG)
60 60
        request = factory.get(signature.sign_url(URL + AUTH_QUERY, key))
61
-