Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : bkabrda-workspace
---------------------------------------------------------------
commit c79f63a78dd669efb5b01a3fb9f5e8aee33e028f
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Mon Nov 26 13:15:02 2012 +0100
Yet some more fixes
---------------------------------------------------------------
wsgi/coprs/views/coprs_ns/coprs_general.py | 2 +-
.../tests/test_views/test_coprs_ns/test_general.py | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/wsgi/coprs/views/coprs_ns/coprs_general.py
b/wsgi/coprs/views/coprs_ns/coprs_general.py
index d370bbf..bc32dc4 100644
--- a/wsgi/coprs/views/coprs_ns/coprs_general.py
+++ b/wsgi/coprs/views/coprs_ns/coprs_general.py
@@ -161,7 +161,7 @@ def copr_permissions_applier_change(username, coprname):
permission.copr_builder = new_builder
permission.copr_admin = new_admin
db.session.commit()
- flask.flash('Successfuly updated your permissions in Copr
"{0}".'.format(copr.name))
+ flask.flash('Successfuly updated permissions in Copr
"{0}".'.format(copr.name))
else:
if new_builder == approved_num or new_admin == approved_num:
flask.flash('User can\'t approve himself.')
diff --git a/wsgi/tests/test_views/test_coprs_ns/test_general.py
b/wsgi/tests/test_views/test_coprs_ns/test_general.py
index d5088cf..6e11d2a 100644
--- a/wsgi/tests/test_views/test_coprs_ns/test_general.py
+++ b/wsgi/tests/test_views/test_coprs_ns/test_general.py
@@ -174,22 +174,24 @@ class TestCoprUpdate(CoprsTestCase):
follow_redirects = True)
assert 'Copr was updated successfully' in r.data
-class TestCoprApplyForBuilding(CoprsTestCase):
+class TestCoprApplyForPermissions(CoprsTestCase):
def test_apply(self, f_users, f_coprs):
with self.tc as c:
with c.session_transaction() as s:
s['openid'] = self.u2.openid_name
self.db.session.add_all([self.u1, self.u2, self.c1])
- r =
c.post('/coprs/detail/{0}/{1}/apply_for_building/'.format(self.u1.name,
self.c1.name),
+ r =
c.post('/coprs/detail/{0}/{1}/permissions_applier_change/'.format(self.u1.name,
self.c1.name),
+ data = {'copr_builder': 1, 'copr_admin': 0},
follow_redirects = True)
- assert 'You have successfuly applied' in r.data
+ assert 'Successfuly applied' in r.data
self.db.session.add_all([self.u1, self.u2, self.c1])
new_perm =
self.models.CoprPermission.query.filter(self.models.CoprPermission.user_id ==
self.u2.id).\
filter(self.models.CoprPermission.copr_id == self.c1.id).\
first()
- assert not new_perm.copr_builder
+ assert new_perm.copr_builder == 1
+ assert new_perm.copr_admin == 0
class TestCoprGiveUpBuilding(CoprsTestCase):
def test_give_up(self, f_users, f_coprs, f_copr_permissions):