Commits

Olemis Lang committed c48b9b6

BH Multiproduct #671 : Test case for product rename

  • Participants
  • Parent commits d48b823
  • Branches t671_product_edit_author

Comments (0)

Files changed (2)

 t669/t669_r1525378_product_edit.tests.diff
 t387/t387_r1524640_no_r5994.diff
 t671/t671_r1526159_product_edit_author.diff
+t671/t671_r1526159_product_edit_author.tests.diff

File t671/t671_r1526159_product_edit_author.tests.diff

+# HG changeset patch
+# Parent 5b63e01cf44d245890ea662b627699bf78a9afdc
+BH Multiproduct #671 : Verify that author is included in product edit comments
+
+diff -r 5b63e01cf44d bloodhound_multiproduct/tests/functional/product.py
+--- a/bloodhound_multiproduct/tests/functional/product.py	Wed Sep 25 19:21:53 2013 -0500
++++ b/bloodhound_multiproduct/tests/functional/product.py	Thu Sep 26 10:30:20 2013 -0500
+@@ -17,13 +17,14 @@
+ #  specific language governing permissions and limitations
+ #  under the License.
+ 
+-from uuid import uuid4
+-
+ from trac.tests import contentgen
+ from trac.tests import functional
+ from trac.tests.functional.tester import tc
+ 
+ import unittest
++from uuid import uuid4
++
++from tests.functional import MultiproductFunctionalTestCase
+ 
+ #----------------
+ # Functional test cases for products
+@@ -71,6 +72,34 @@
+         tc.find(prefix)
+ 
+ 
++class TestProductRenameAuthor(MultiproductFunctionalTestCase, 
++                              functional.FunctionalTwillTestCaseSetup):
++    def runTest(self):
++        """Author in ticket comments for product rename
++        """
++        orig_name = contentgen.random_sentence()
++        prefix = self._tester.create_product()
++        with self.in_product(prefix) as (testenv, tester):
++            t1 = tester.create_ticket()
++            t2 = tester.create_ticket()
++        tc.go(self._tester.url + '/products')
++        tc.follow('.*/products/' + prefix + r'\?action=edit')
++        tc.find('Edit Product')
++        tc.find(prefix)
++        # Ensure that name is different and unique
++        new_name = '%s-%s' % (orig_name, str(uuid4()))
++        tc.formvalue('edit', 'name', new_name)
++        tc.submit()
++        tc.find('Your changes have been saved')
++        with self.in_product(prefix) as (testenv, tester):
++            tester.go_to_ticket(t1)
++            comment = 'Product %s renamed to %s' % (orig_name, new_name)
++            tc.find(comment)
++            tester.go_to_ticket(t2)
++            tc.find(comment)
++            
++
++
+ def functionalSuite(suite=None):
+     if not suite:
+         import tests.functional
+@@ -79,6 +108,7 @@
+     suite.addTest(TestNewProduct())
+     suite.addTest(TestProductListAnonymous())
+     suite.addTest(TestProductListAuth())
++    suite.addTest(TestProductRenameAuthor())
+     return suite
+ 
+ if __name__ == '__main__':