Ticket #1106: rename_functional_tests.diff
| File rename_functional_tests.diff, 6.9 KB (added by shookie@…, 3 years ago) |
|---|
-
trac/admin/tests/console-tests.txt
diff -Naur -x .svn trac-branchA/trac/admin/tests/console-tests.txt trac-branchB/trac/admin/tests/console-tests.txt
old new 105 105 SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, 106 106 TICKET_EDIT_CC, TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, 107 107 TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, 108 WIKI_MODIFY, WIKI_ VIEW108 WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW 109 109 110 110 ===== test_permission_add_one_action_ok ===== 111 111 … … 139 139 SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, 140 140 TICKET_EDIT_CC, TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, 141 141 TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, 142 WIKI_MODIFY, WIKI_ VIEW142 WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW 143 143 144 144 ===== test_permission_add_multiple_actions_ok ===== 145 145 … … 174 174 SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, 175 175 TICKET_EDIT_CC, TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, 176 176 TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, 177 WIKI_MODIFY, WIKI_ VIEW177 WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW 178 178 179 179 ===== test_permission_remove_one_action_ok ===== 180 180 … … 207 207 SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, 208 208 TICKET_EDIT_CC, TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, 209 209 TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, 210 WIKI_MODIFY, WIKI_ VIEW210 WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW 211 211 212 212 ===== test_permission_remove_multiple_actions_ok ===== 213 213 … … 240 240 SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE, 241 241 TICKET_EDIT_CC, TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, 242 242 TIMELINE_VIEW, TRAC_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, 243 WIKI_MODIFY, WIKI_ VIEW243 WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW 244 244 245 245 ===== test_component_list_ok ===== 246 246 -
trac/tests/functional/tester.py
diff -Naur -x .svn trac-branchA/trac/tests/functional/tester.py trac-branchB/trac/tests/functional/tester.py
old new 183 183 tc.formvalue('attachment', 'replace', True) 184 184 tc.submit() 185 185 tc.url(self.url + '/attachment/ticket/%s/$' % ticketid) 186 return tempfilename 186 187 187 188 def clone_ticket(self, ticketid): 188 189 """Create a clone of the given ticket id using the clone button.""" … … 239 240 tc.formvalue('attachment', 'description', random_sentence()) 240 241 tc.submit() 241 242 tc.url(self.url + '/attachment/wiki/%s/$' % name) 243 return tempfilename 242 244 243 245 def create_milestone(self, name=None, due=None): 244 246 """Creates the specified milestone, with a random name if none is -
trac/wiki/templates/wiki_view.html
diff -Naur -x .svn trac-branchA/trac/wiki/templates/wiki_view.html trac-branchB/trac/wiki/templates/wiki_view.html
old new 94 94 </py:if> 95 95 </py:if> 96 96 <py:if test="page.exists and rename_perm"> 97 <form method="get" action="${href.wiki(page.name)}">98 <div id="rename">97 <form id="rename" method="get" action="${href.wiki(page.name)}"> 98 <div> 99 99 <input type="hidden" name="action" value="rename" /> 100 100 <input type="submit" value="${_('Rename page')}" /> 101 101 </div> -
trac/wiki/tests/functional.py
diff -Naur -x .svn trac-branchA/trac/wiki/tests/functional.py trac-branchB/trac/wiki/tests/functional.py
old new 11 11 self._tester.attach_file_to_wiki(pagename) 12 12 13 13 14 class TestWikiRename(FunctionalTwillTestCaseSetup): 15 def runTest(self): 16 """Test for simple wiki rename""" 17 # create a new page (with one attachment) 18 pagename = random_unique_camel() 19 self._tester.create_wiki_page(pagename) 20 attachment = self._tester.attach_file_to_wiki(pagename) 21 base_url = self._tester.url 22 page_url = base_url + "/wiki/" + pagename 23 24 def click_rename(): 25 tc.formvalue('rename', 'action', 'rename') 26 tc.submit() 27 tc.url(page_url+r'\?action=rename') 28 tc.find("New name:") 29 30 tc.go(page_url) 31 tc.find("Rename") 32 click_rename() 33 # attempt to rename the page to the current page name ... 34 tc.formvalue('rename', 'new_name', pagename) 35 tc.submit('rename') 36 tc.url(page_url) 37 #tc.save_html("rename_warning.html") 38 tc.find("New name must be different from old name.") 39 # attempt to rename the page to an existing page name ... 40 tc.formvalue('rename', 'new_name', 'WikiStart') 41 tc.submit('rename') 42 tc.url(page_url) 43 tc.find("Trac Error") 44 tc.find("Can't rename to existing WikiStart page") 45 # correct rename to new page name (old page replaced by a redirection) 46 tc.go(page_url) 47 click_rename() 48 newpagename = pagename+'Renamed' 49 tc.formvalue('rename', 'new_name', newpagename) 50 tc.formvalue('rename', 'leave_redirection', True) # the default 51 tc.submit('rename') 52 # check redirection page 53 tc.url(page_url) 54 tc.find("See.*/wiki/"+newpagename) 55 # check whether attachment exists on the new page but not on old page 56 tc.go(base_url+'/attachment/wiki/'+newpagename+'/'+attachment) 57 tc.notfind("Error: Invalid Attachment") 58 tc.go(base_url+'/attachment/wiki/'+pagename+'/'+attachment) 59 tc.find("Error: Invalid Attachment") 60 # rename again to another new page name (this time, no redirection) 61 tc.go(page_url) 62 click_rename() 63 newpagename = pagename+'RenamedAgain' 64 tc.formvalue('rename', 'new_name', newpagename) 65 tc.formvalue('rename', 'leave_redirection', False) 66 tc.submit('rename') 67 tc.url(base_url + "/wiki/" + newpagename) 68 # this time, the original page is gone 69 tc.go(page_url) 70 tc.url(page_url) 71 tc.find("Describe %s here" % pagename) 72 73 14 74 class RegressionTestTicket4812(FunctionalTwillTestCaseSetup): 15 75 def runTest(self): 16 76 """Test for regression of http://trac.edgewall.org/ticket/4812""" … … 62 122 import trac.tests.functional.testcases 63 123 suite = trac.tests.functional.testcases.functionalSuite() 64 124 suite.addTest(TestWiki()) 125 suite.addTest(TestWikiRename()) 65 126 suite.addTest(RegressionTestTicket4812()) 66 127 if has_docutils: 67 128 suite.addTest(ReStructuredTextWikiTest())
