bodhi/templates/show.kid | 36 ++++++++++++++++++++++--------- bodhi/tests/test_controllers.py | 46 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 11 deletions(-)
New commits: commit b460f3b9ba02b9aba9ed5362dc7879df92faa402 Author: Luke Macken lmacken@redhat.com Date: Thu Jan 7 22:08:20 2010 -0500
[No Frozen Rawhide] Fix some of our update action logic, along with tests
diff --git a/bodhi/templates/show.kid b/bodhi/templates/show.kid index 8e7c8af..e81518a 100644 --- a/bodhi/templates/show.kid +++ b/bodhi/templates/show.kid @@ -69,14 +69,23 @@ karma = "<img src="%s" align="top" /> <b>%d</b>" % (tg.url('/static/images/k </td> <span py:if="update.release.locked and update.critpath"> <span py:if="'qa' in tg.identity.groups or 'releng' in tg.identity.groups"> - <td> - <a href="${util.url('/request/stable/%s' % update.title)}" class="list"> - <img src="${tg.url('/static/images/submit.png')}" border="0"/> - Push Critical Path update to Stable - </a> - </td> + <td> + <a href="${util.url('/request/stable/%s' % update.title)}" class="list"> + <img src="${tg.url('/static/images/submit.png')}" border="0"/> + Push Critical Path update to Stable + </a> + </td> + </span> + </span> + <span py:if="update.release.locked and not update.critpath"> + <td> + <a href="${util.url('/request/stable/%s' % update.title)}" class="list"> + <img src="${tg.url('/static/images/submit.png')}" border="0"/> + Push to Stable + </a> + </td> </span> - <span py:if="not update.release.locked or not update.critpath"> + <span py:if="not update.release.locked"> <td> <a href="${util.url('/request/stable/%s' % update.title)}" class="list"> <img src="${tg.url('/static/images/submit.png')}" border="0"/> @@ -84,7 +93,6 @@ karma = "<img src="%s" align="top" /> <b>%d</b>" % (tg.url('/static/images/k </a> </td> </span> - </span> <td> <a href="${util.url('/confirm_delete?nvr=%s' % update.title)}" class="list"> <img src="${tg.url('/static/images/trash.png')}" border="0"/> @@ -118,15 +126,23 @@ karma = "<img src="%s" align="top" /> <b>%d</b>" % (tg.url('/static/images/k </td> </span> </span> - <span py:if="not update.release.locked or not update.critpath"> + <span py:if="not update.critpath"> <td> <a href="${util.url('/request/stable/%s' % update.title)}" class="list"> <img src="${tg.url('/static/images/submit.png')}" border="0"/> Mark as Stable </a> </td> - </span> </span> + </span> + <span py:if="not update.release.locked"> + <td> + <a href="${util.url('/request/stable/%s' % update.title)}" class="list"> + <img src="${tg.url('/static/images/submit.png')}" border="0"/> + Mark as Stable + </a> + </td> + </span> <td> <a href="${util.url('/edit/%s' % update.title)}" class="list"> <img src="${tg.url('/static/images/edit.png')}" border="0"/> diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py index ad6a029..c0dd645 100644 --- a/bodhi/tests/test_controllers.py +++ b/bodhi/tests/test_controllers.py @@ -1264,6 +1264,50 @@ class TestControllers(testutil.DBTest): update = PackageUpdate.byTitle(params['builds']) assert update.request == 'stable'
+ def test_critpath_actions_in_normal_release(self): + session = login() + create_release() + params = { + 'builds' : 'kernel-2.6.31-1.fc7', + 'release' : 'Fedora 7', + 'type_' : 'bugfix', + 'bugs' : '', + 'notes' : 'foobar', + 'stable_karma' : 1, + 'request': None, + 'unstable_karma' : -1, + } + self.save_update(params, session) + update = PackageUpdate.byTitle(params['builds']) + assert update.request == None + + testutil.create_request('/updates/%s' % params['builds'], + method='GET', headers=session) + assert "Push to Stable" in cherrypy.response.body[0] + assert "Push to Testing" in cherrypy.response.body[0] + + def test_non_critpath_actions_in_normal_release(self): + session = login() + create_release() + params = { + 'builds' : 'nethack-2.6.31-1.fc7', + 'release' : 'Fedora 7', + 'type_' : 'bugfix', + 'bugs' : '', + 'notes' : 'foobar', + 'stable_karma' : 1, + 'request': None, + 'unstable_karma' : -1, + } + self.save_update(params, session) + update = PackageUpdate.byTitle(params['builds']) + assert update.request == None + + testutil.create_request('/updates/%s' % params['builds'], + method='GET', headers=session) + assert "Push to Testing" in cherrypy.response.body[0] + assert "Push to Stable" in cherrypy.response.body[0], cherrypy.response.body[0] + def test_push_critpath_to_frozen_release(self): session = login() create_release(locked=True) @@ -1434,7 +1478,7 @@ class TestControllers(testutil.DBTest): testutil.create_request('/updates/%s' % params['builds'], method='GET', headers=session)
- assert "/updates/request/stable" in cherrypy.response.body[0] + assert "/updates/request/stable" in cherrypy.response.body[0], cherrypy.response.body[0]
def test_critpath_to_frozen_release_testing_admin_actions(self): """