Skip to content

Commit

Permalink
test(ui_remote_pr): redirect response changed
Browse files Browse the repository at this point in the history
'the' added into the redirect response in werkzeug version >= 2.1.2

Reference:
pallets/werkzeug@1094fbf
  • Loading branch information
wombelix committed Jan 22, 2023
1 parent 6e1b839 commit efc12ec
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions tests/test_pagure_flask_ui_remote_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import unittest

import pygit2
import werkzeug
import wtforms
from mock import patch, MagicMock
from bs4 import BeautifulSoup
Expand Down Expand Up @@ -173,9 +174,21 @@ def test_new_remote_pr_unauth(self):
# Try creating a remote PR
output = self.app.get("/test/diff/remote")
self.assertEqual(output.status_code, 302)
self.assertIn(
expected_response = (
"You should be redirected automatically to target URL: "
'<a href="/login/?',
'<a href="/login/?'
)
if hasattr(werkzeug, "__version__"):
werkzeug_v = tuple(
int(el) for el in werkzeug.__version__.split(".")
)
if werkzeug_v >= (2, 1, 2):
expected_response = (
"You should be redirected automatically to the target URL: "
'<a href="/login/?'
)
self.assertIn(
expected_response,
output.get_data(as_text=True),
)

Expand Down

0 comments on commit efc12ec

Please sign in to comment.