| |
@@ -584,6 +584,62 @@
|
| |
output = self.app.get('/test/roadmap', data=data)
|
| |
self.assertEqual(output.status_code, 404)
|
| |
|
| |
+ @patch('pagure.lib.git.update_git')
|
| |
+ @patch('pagure.lib.notify.send_email')
|
| |
+ def test_show_ban_lock_unlock_in_roadmap_ui(self, send_email, update_git):
|
| |
+ send_email.return_value = True
|
| |
+ update_git.return_value = True
|
| |
+
|
| |
+ tests.create_projects(self.session)
|
| |
+ tests.create_projects_git(
|
| |
+ os.path.join(self.path, 'repos'), bare=True)
|
| |
+
|
| |
+ # Create issues to play with
|
| |
+ repo = pagure.lib.get_authorized_project(self.session, 'test')
|
| |
+ repo.milestones = {'0.1': ''}
|
| |
+
|
| |
+ issue_1 = pagure.lib.new_issue(
|
| |
+ session=self.session,
|
| |
+ repo=repo,
|
| |
+ title='Test issue',
|
| |
+ content='We should work on this',
|
| |
+ user='pingou',
|
| |
+ ticketfolder=None,
|
| |
+ milestone='0.1',
|
| |
+ )
|
| |
+
|
| |
+ repo = pagure.lib.get_authorized_project(self.session, 'test')
|
| |
+ issue_2 = pagure.lib.new_issue(
|
| |
+ session=self.session,
|
| |
+ repo=repo,
|
| |
+ title='Test issue #2',
|
| |
+ content='We should work on this again',
|
| |
+ user='foo',
|
| |
+ ticketfolder=None,
|
| |
+ milestone='0.1',
|
| |
+ )
|
| |
+
|
| |
+ issue_1.children.append(issue_2)
|
| |
+ self.session.commit()
|
| |
+
|
| |
+ user = tests.FakeUser()
|
| |
+ user.username = 'pingou'
|
| |
+ with tests.user_set(self.app.application, user):
|
| |
+ output = self.app.get('/test/roadmap')
|
| |
+ output_text = output.get_data(as_text=True)
|
| |
+ self.assertIn(
|
| |
+ '<span class="oi" data-glyph="ban" '
|
| |
+ 'title="Issue blocked by one or more issue(s)"></span>',
|
| |
+ output_text)
|
| |
+ self.assertEqual(1, output_text.count(
|
| |
+ 'title="Issue blocked by one or more issue(s)'))
|
| |
+ self.assertIn(
|
| |
+ '<span class="oi" data-glyph="lock-unlocked" '
|
| |
+ 'title="Issue blocking one or more issue(s)"></span>',
|
| |
+ output_text)
|
| |
+ self.assertEqual(1, output_text.count(
|
| |
+ 'title="Issue blocking one or more issue(s)'))
|
| |
+
|
| |
|
| |
if __name__ == '__main__':
|
| |
unittest.main(verbosity=2)
|
| |
Signed-off-by: Chenxiong Qi cqi@redhat.com