diff --git a/tests/__init__.py b/tests/__init__.py
index 0aa4ebb..0d34759 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -257,6 +257,7 @@ def create_projects(session):
description='test project #1',
hook_token='aaabbbccc',
)
+ item.close_status = ['Invalid', 'Insufficient data', 'Fixed', 'Duplicate']
session.add(item)
item = pagure.lib.model.Project(
@@ -265,6 +266,7 @@ def create_projects(session):
description='test project #2',
hook_token='aaabbbddd',
)
+ item.close_status = ['Invalid', 'Insufficient data', 'Fixed', 'Duplicate']
session.add(item)
session.commit()
diff --git a/tests/test_pagure_flask_ui_issues.py b/tests/test_pagure_flask_ui_issues.py
index 0cf262f..51261d7 100644
--- a/tests/test_pagure_flask_ui_issues.py
+++ b/tests/test_pagure_flask_ui_issues.py
@@ -509,7 +509,8 @@ class PagureFlaskIssuestests(tests.Modeltests):
'name="csrf_token" type="hidden" value="')[1].split('">')[0]
data = {
- 'status': 'fixed'
+ 'status': 'Closed',
+ 'close_status': 'fixed'
}
# Invalid repo
@@ -535,7 +536,7 @@ class PagureFlaskIssuestests(tests.Modeltests):
in output.data)
# Right status, wrong csrf
- data['status'] = 'Fixed'
+ data['close_status'] = 'Fixed'
output = self.app.post(
'/test/issue/1/update', data=data, follow_redirects=True)
self.assertEqual(output.status_code, 200)
@@ -570,7 +571,7 @@ class PagureFlaskIssuestests(tests.Modeltests):
in output.data)
self.assertIn(
'
'
- '@pingou changed the status to Fixed
'
+ '@pingou changed the status to Closed
'
'
'.format(
app_url=pagure.APP.config['APP_URL'].rstrip('/')),
output.data)
@@ -578,7 +579,8 @@ class PagureFlaskIssuestests(tests.Modeltests):
# Add new comment
data = {
'csrf_token': csrf_token,
- 'status': 'Fixed',
+ 'status': 'Closed',
+ 'close_status': 'Fixed',
'comment': 'Woohoo a second comment !',
}
output = self.app.post(
@@ -607,7 +609,8 @@ class PagureFlaskIssuestests(tests.Modeltests):
# Add new tag
data = {
'csrf_token': csrf_token,
- 'status': 'Fixed',
+ 'status': 'Closed',
+ 'close_status': 'Fixed',
'tag': 'tag2',
}
output = self.app.post(
@@ -630,7 +633,8 @@ class PagureFlaskIssuestests(tests.Modeltests):
# Assign issue to an non-existent user
data = {
'csrf_token': csrf_token,
- 'status': 'Fixed',
+ 'status': 'Closed',
+ 'close_status': 'Fixed',
'assignee': 'ralph',
}
output = self.app.post(
@@ -656,7 +660,8 @@ class PagureFlaskIssuestests(tests.Modeltests):
# Assign issue properly
data = {
'csrf_token': csrf_token,
- 'status': 'Fixed',
+ 'status': 'Closed',
+ 'close_status': 'Fixed',
'assignee': 'pingou',
}
output = self.app.post(
@@ -696,8 +701,9 @@ class PagureFlaskIssuestests(tests.Modeltests):
# Reset the status of the first issue
parent_issue = pagure.lib.search_issues(
- self.session, repo, issueid=2)
+ self.session, repo, issueid=1)
parent_issue.status = 'Open'
+ self.session.add(parent_issue)
# Add the dependency relationship
self.session.add(parent_issue)
issue = pagure.lib.search_issues(self.session, repo, issueid=2)
diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py
index e946395..09fb942 100644
--- a/tests/test_pagure_lib.py
+++ b/tests/test_pagure_lib.py
@@ -1044,9 +1044,7 @@ class PagureLibtests(tests.Modeltests):
def test_get_issue_statuses(self):
""" Test the get_issue_statuses of pagure.lib. """
statuses = pagure.lib.get_issue_statuses(self.session)
- self.assertEqual(
- sorted(statuses),
- ['Duplicate', 'Fixed', 'Insufficient data', 'Invalid', 'Open'])
+ self.assertEqual(sorted(statuses), ['Closed', 'Open'])
def test_set_up_user(self):
""" Test the set_up_user of pagure.lib. """