From b4f437875db1984ca8aa1d0bd5af5025389bac05 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 27 2015 13:12:42 +0000 Subject: Make tests for add_issue_tag check behavior for duplicate tags --- diff --git a/tests/test_progitlib.py b/tests/test_progitlib.py index e620a3f..b8108d9 100644 --- a/tests/test_progitlib.py +++ b/tests/test_progitlib.py @@ -243,6 +243,16 @@ class ProgitLibtests(tests.Modeltests): self.session.commit() self.assertEqual(msg, 'Tag added') + # Try a second time + msg = progit.lib.add_issue_tag( + session=self.session, + issue=issue, + tag='tag1', + user='pingou', + ticketfolder=None) + self.session.commit() + self.assertEqual(msg, 'Tag already present: tag1') + issues = progit.lib.search_issues(self.session, repo, tags='tag1') self.assertEqual(len(issues), 1) self.assertEqual(issues[0].id, 1)