Olemis Lang avatar Olemis Lang committed fe5544f

BH Relations #670 : Test case for repeated relation type (empty)

Comments (0)

Files changed (2)

 t598/t598_r1510975_functional_tester_product.diff
 t387/t387_r1515319_functional_test.6.diff
 t387/t387_r1515319_functional_test.7.diff
+t670/t670_r1526159_relation_type_empty.diff
 t387/t387_r1524640_no_r5994.diff

t670/t670_r1526159_relation_type_empty.diff

+# HG changeset patch
+# Parent 23011643ba01943732e18b444d1b26df69138573
+BH Relations #670 : Fix empty relation type
+
+diff -r 23011643ba01 bloodhound_relations/bhrelations/tests/functional.py
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/bloodhound_relations/bhrelations/tests/functional.py	Thu Sep 26 19:22:22 2013 -0500
+@@ -0,0 +1,72 @@
++# -*- coding: utf-8 -*-
++#
++#  Licensed to the Apache Software Foundation (ASF) under one
++#  or more contributor license agreements.  See the NOTICE file
++#  distributed with this work for additional information
++#  regarding copyright ownership.  The ASF licenses this file
++#  to you under the Apache License, Version 2.0 (the
++#  "License"); you may not use this file except in compliance
++#  with the License.  You may obtain a copy of the License at
++#
++#   http://www.apache.org/licenses/LICENSE-2.0
++#
++#  Unless required by applicable law or agreed to in writing,
++#  software distributed under the License is distributed on an
++#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++#  KIND, either express or implied.  See the License for the
++#  specific language governing permissions and limitations
++#  under the License.
++
++from trac.tests.functional import FunctionalTwillTestCaseSetup, tc
++
++from tests import functional
++
++import unittest
++
++#--------------------------
++# Testing shortcuts
++#--------------------------
++
++def go_to_relations(tester, ticketid):
++    url = "%s/ticket/%s/relations" % (tester.url, ticketid)
++    tc.go(url)
++    tc.url(url)
++    return url
++
++def add_relation(tester, from_ticket, to_ticket, reltype, comment=None):
++    url = go_to_relations(tester, from_ticket)
++    tc.formvalue('addrelation', 'reltype', 'refersto')
++    tc.formvalue('addrelation', 'dest_tid', str(to_ticket))
++    if comment:
++        tc.formvalue('addrelation', 'comment', comment)
++    tc.submit()
++    tc.url(url)
++    # TODO: Assert that relation is actually added
++
++class RegressionTestBhTicket670(FunctionalTwillTestCaseSetup):
++    BH_IN_DEFAULT_PRODUCT = True
++
++    def runTest(self):
++        """bh:ticket:670 - Empty relation type
++        """
++        tester = self._tester
++        t1 = self._tester.create_ticket()
++        t2 = self._tester.create_ticket()
++        t3 = self._tester.create_ticket()
++        add_relation(tester, t1, t2, 'refersto')
++        add_relation(tester, t1, t3, 'refersto')
++        # Already in relations page
++        tc.find('<td>refers to</td>.*<td>refers to</td>')
++
++
++def test_suite(suite=None):
++    if suite is None:
++        suite = functional.MultiproductFunctionalTestSuite()
++
++    suite.addTest(RegressionTestBhTicket670())
++
++    return suite
++
++if __name__ == '__main__':
++    unittest.main(defaultTest='test_suite')
++
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.