Skip to content

Commit

Permalink
Add additional test for push to stable button
Browse files Browse the repository at this point in the history
  • Loading branch information
crungehottman authored and bowlofeggs committed Aug 14, 2017
1 parent 7242f72 commit c230d99
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions bodhi/tests/server/services/test_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3684,6 +3684,29 @@ def test_autopush_non_critical_update_with_no_negative_karma(self, publish, *arg
up = self.db.query(Update).filter_by(title=resp.json['title']).one()
self.assertEquals(up.request, UpdateRequest.batched)

@mock.patch(**mock_valid_requirements)
@mock.patch('bodhi.server.notifications.publish')
def test_manually_push_to_stable_from_batched(self, publish, *args):
"""
Test manually push to stable from batched when autokarma is disabled
"""
nvr = u'bodhi-2.0.0-2.fc17'
args = self.get_update(nvr)
resp = self.app.post_json('/updates/', args)

update = Update.get(nvr, self.db)
update.status = UpdateStatus.testing
update.request = UpdateRequest.batched
self.db.commit()

# Checks Push to Stable text in the html page for this update
id = 'bodhi-2.0.0-2.fc17'
resp = self.app.get('/updates/%s' % id,
headers={'Accept': 'text/html'})
self.assertIn('text/html', resp.headers['Content-Type'])
self.assertIn(id, resp)
self.assertIn('Push to Stable', resp)

@mock.patch(**mock_valid_requirements)
@mock.patch('bodhi.server.notifications.publish')
def test_manually_push_to_stable_based_on_karma(self, publish, *args):
Expand Down

0 comments on commit c230d99

Please sign in to comment.