============================= test session starts ============================== platform linux -- Python 3.4.3 -- py-1.4.31 -- pytest-2.7.2 rootdir: /home/matthias/projects/python/my_app/Flask-User-starter-app/tests, inifile: plugins: cov, flask collected 1 items tests/test_page_urls.py F =================================== FAILURES =================================== ________________________________ test_page_urls ________________________________ client = > def test_page_urls(client): # Visit home page response = client.get(url_for('core.home_page')) assert b'

Home page

' in response.data # Login as user and visit User page response = client.post(url_for('user.login'), follow_redirects=True, > data=dict(email='user@example.com', password='Password1')) tests/test_page_urls.py:16: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../../../../.virtualenvs/my_app/lib/python3.4/site-packages/werkzeug/test.py:788: in post return self.open(*args, **kw) ../../../../.virtualenvs/my_app/lib/python3.4/site-packages/flask/testing.py:113: in open follow_redirects=follow_redirects) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = > args = (,), kwargs = {} as_tuple = False, buffered = False, follow_redirects = True environ = {'CONTENT_LENGTH': '0', 'CONTENT_TYPE': '', 'HTTP_COOKIE': 'session=.eJwNxUsKwyAQANCrDLPJJlSrhDTepJQQ_EyqYGNxdBVy9_Zt3...Ex1uOF6rSNuKaBBvdjZkaZgyflFyXCflJfzQ1vaJ6kUXj9Dniof.Cp40GA.8gB8h85sU1ZDw3uZfDZea3x_Zrg', 'HTTP_HOST': 'localhost', ...} response = (, '302 FOUND', Headers([('Content-Type', 'text/html; charset=utf-8'), ('Content-Length', '249'), ('Location', 'http://localhost/user')])) redirect_chain = [('http://localhost/user', 302), ('http://localhost/user/sign-in?next=http%3A//localhost/user', 302)] status_code = 302, new_location = 'http://localhost/user' new_redirect_entry = ('http://localhost/user', 302) def open(self, *args, **kwargs): """Takes the same arguments as the :class:`EnvironBuilder` class with some additions: You can provide a :class:`EnvironBuilder` or a WSGI environment as only argument instead of the :class:`EnvironBuilder` arguments and two optional keyword arguments (`as_tuple`, `buffered`) that change the type of the return value or the way the application is executed. .. versionchanged:: 0.5 If a dict is provided as file in the dict for the `data` parameter the content type has to be called `content_type` now instead of `mimetype`. This change was made for consistency with :class:`werkzeug.FileWrapper`. The `follow_redirects` parameter was added to :func:`open`. Additional parameters: :param as_tuple: Returns a tuple in the form ``(environ, result)`` :param buffered: Set this to True to buffer the application run. This will automatically close the application for you as well. :param follow_redirects: Set this to True if the `Client` should follow HTTP redirects. """ as_tuple = kwargs.pop('as_tuple', False) buffered = kwargs.pop('buffered', False) follow_redirects = kwargs.pop('follow_redirects', False) environ = None if not kwargs and len(args) == 1: if isinstance(args[0], EnvironBuilder): environ = args[0].get_environ() elif isinstance(args[0], dict): environ = args[0] if environ is None: builder = EnvironBuilder(*args, **kwargs) try: environ = builder.get_environ() finally: builder.close() response = self.run_wsgi_app(environ, buffered=buffered) # handle redirects redirect_chain = [] while 1: status_code = int(response[1].split(None, 1)[0]) if status_code not in (301, 302, 303, 305, 307) \ or not follow_redirects: break new_location = response[2]['location'] new_redirect_entry = (new_location, status_code) if new_redirect_entry in redirect_chain: > raise ClientRedirectError('loop detected') E werkzeug.test.ClientRedirectError: loop detected ../../../../.virtualenvs/my_app/lib/python3.4/site-packages/werkzeug/test.py:763: ClientRedirectError =========================== 1 failed in 0.05 seconds ===========================