Exemplo n.º 1
0
    def runTest(self):
        """Admin renumber priorities"""
        valuesRE = re.compile(b'<select name="value_([0-9]+)">', re.M)
        html = b.get_html()
        max_priority = max([int(x) for x in valuesRE.findall(html)])

        name = "RenumberPriority"
        self._testenv.add_priority(name + '1')
        self._testenv.add_priority(name + '2')
        self._tester.go_to_url('/admin/ticket/priority')
        tc.find(name + '1')
        tc.find(name + '2')
        tc.formvalue('enumtable', 'value_%s' % (max_priority + 1),
                     str(max_priority + 2))
        tc.formvalue('enumtable', 'value_%s' % (max_priority + 2),
                     str(max_priority + 1))
        tc.submit('apply')
        priority_url = self._tester.url + '/admin/ticket/priority'
        tc.url(priority_url, regexp=False)
        # Verify that their order has changed.
        tc.find(name + '2.*' + name + '1', 's')
Exemplo n.º 2
0
    def runTest(self):
        """Admin renumber priorities"""
        valuesRE = re.compile('<select name="value_([0-9]+)">', re.M)
        html = b.get_html()
        max_priority = max([int(x) for x in valuesRE.findall(html)])

        name = "RenumberPriority"
        self._tester.create_priority(name + '1')
        self._tester.create_priority(name + '2')
        priority_url = self._tester.url + '/admin/ticket/priority'
        tc.go(priority_url)
        tc.url(priority_url + '$')
        tc.find(name + '1')
        tc.find(name + '2')
        tc.formvalue('enumtable',
                     'value_%s' % (max_priority + 1), str(max_priority + 2))
        tc.formvalue('enumtable',
                     'value_%s' % (max_priority + 2), str(max_priority + 1))
        tc.submit('apply')
        tc.url(priority_url + '$')
        # Verify that their order has changed.
        tc.find(name + '2.*' + name + '1', 's')