Project

General

Profile

Revision c7381c8d

IDc7381c8df714614893aa831f92f81b3531bce243
Parent fab6312f
Child 381c8771

Added by Aurelien BOMPARD almost 14 years ago

Correction des tests

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@4265 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigigraph/tests/functional/test_authentication.py
35 35
        form['password'] = u'managepass'
36 36
        post_login = form.submit(status=302)
37 37
        # Being redirected to the home page:
38
        assert post_login.location.startswith('http://localhost/post_login')
38
        assert post_login.location.startswith('/post_login'), "Result: %s" % post_login.location
39 39
        home_page = post_login.follow(status=302)
40 40
        assert 'authtkt' in home_page.request.cookies, \
41 41
               'Session cookie was not defined: %s' % home_page.request.cookies
42
        assert home_page.location == 'http://localhost/'
42
        assert home_page.location == 'http://localhost/', "Result: %s" % home_page.location
43 43

  
44 44
    def test_logout(self):
45 45
        """Logouts must work correctly"""
......
51 51
               'Session cookie was not defined: %s' % resp.request.cookies
52 52
        # Logging out:
53 53
        resp = self.app.get('/logout_handler', status=302)
54
        assert resp.location.startswith('http://localhost/post_logout')
54
        assert resp.location.startswith('/post_logout'), "Result: %s" % resp.location
55 55
        # Finally, redirected to the home page:
56 56
        home_page = resp.follow(status=302)
57
        assert home_page.request.cookies.get('authtkt') == '', \
57
        assert home_page.request.cookies.get('authtkt') == '' \
58
                or home_page.request.cookies.get('authtkt') == 'INVALID', \
58 59
               'Session cookie was not deleted: %s' % home_page.request.cookies
59
        assert home_page.location == 'http://localhost/', home_page.location
60
        assert home_page.location == 'http://localhost/', "Result: %s" % home_page.location
60 61

  

Also available in: Unified diff