[PATCH 3/3] Adjust URLs in the unit-tests to their new structure

Pierre-Yves Chibon pingou at pingoured.fr
Fri Sep 27 13:07:37 UTC 2013


These tests should be failing since I changed the urls structure in coprs_build.py.
---
 .../tests/test_views/test_coprs_ns/test_coprs_builds.py    | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py b/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
index f512b18..21a8dc7 100644
--- a/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
+++ b/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
@@ -4,14 +4,14 @@ from tests.coprs_test_case import CoprsTestCase, TransactionDecorator
 
 class TestCoprShowBuilds(CoprsTestCase):
     def test_copr_show_builds(self, f_users, f_coprs, f_builds, f_db):
-        r = self.tc.get('/coprs/detail/{0}/{1}/builds/'.format(self.u2.name, self.c2.name))
+        r = self.tc.get('/coprs/{0}/{1}/builds/'.format(self.u2.name, self.c2.name))
         assert r.data.count('<tr class="build-') == 2
 
 class TestCoprAddBuild(CoprsTestCase):
     @TransactionDecorator('u1')
     def test_copr_owner_can_add_build(self, f_users, f_coprs, f_db):
         self.db.session.add_all([self.u1, self.c1])
-        r = self.test_client.post('/coprs/detail/{0}/{1}/new_build/'.format(self.u1.name, self.c1.name),
+        r = self.test_client.post('/coprs/{0}/{1}/new_build/'.format(self.u1.name, self.c1.name),
                   data = {'pkgs': 'http://testing'},
                   follow_redirects = True)
         assert self.models.Build.query.first().pkgs == 'http://testing'
@@ -19,7 +19,7 @@ class TestCoprAddBuild(CoprsTestCase):
     @TransactionDecorator('u1')
     def test_copr_allowed_user_can_add_build(self, f_users, f_coprs, f_copr_permissions, f_db):
         self.db.session.add_all([self.u2, self.c2])
-        r = self.test_client.post('/coprs/detail/{0}/{1}/new_build/'.format(self.u2.name, self.c2.name),
+        r = self.test_client.post('/coprs/{0}/{1}/new_build/'.format(self.u2.name, self.c2.name),
                   data = {'pkgs': 'http://testing'},
                   follow_redirects = True)
         assert self.models.Build.query.first().pkgs == 'http://testing'
@@ -28,7 +28,7 @@ class TestCoprAddBuild(CoprsTestCase):
     @TransactionDecorator('u1')
     def test_copr_not_yet_allowed_user_cant_add_build(self, f_users, f_coprs, f_copr_permissions, f_db):
         self.db.session.add_all([self.u2, self.c3])
-        r = self.test_client.post('/coprs/detail/{0}/{1}/new_build/'.format(self.u2.name, self.c3.name),
+        r = self.test_client.post('/coprs/{0}/{1}/new_build/'.format(self.u2.name, self.c3.name),
                   data = {'pkgs': 'http://testing'},
                   follow_redirects = True)
         assert not self.models.Build.query.first()
@@ -36,7 +36,7 @@ class TestCoprAddBuild(CoprsTestCase):
     @TransactionDecorator('u3')
     def test_copr_user_without_permission_cant_add_build(self, f_users, f_coprs, f_copr_permissions, f_db):
         self.db.session.add_all([self.u1, self.c1])
-        r = self.test_client.post('/coprs/detail/{0}/{1}/new_build/'.format(self.u1.name, self.c1.name),
+        r = self.test_client.post('/coprs/{0}/{1}/new_build/'.format(self.u1.name, self.c1.name),
                   data = {'pkgs': 'http://testing'},
                   follow_redirects = True)
         assert not self.models.Build.query.first()
@@ -46,7 +46,7 @@ class TestCoprCancelBuild(CoprsTestCase):
     @TransactionDecorator('u1')
     def test_copr_build_submitter_can_cancel_build(self, f_users, f_coprs, f_builds, f_db):
         self.db.session.add_all([self.u1, self.c1, self.b1])
-        r = self.test_client.post('/coprs/detail/{0}/{1}/cancel_build/{2}/'.format(self.u1.name, self.c1.name, self.b1.id),
+        r = self.test_client.post('/coprs/{0}/{1}/cancel_build/{2}/'.format(self.u1.name, self.c1.name, self.b1.id),
                   data = {},
                   follow_redirects = True)
         self.db.session.add(self.b1)
@@ -56,7 +56,7 @@ class TestCoprCancelBuild(CoprsTestCase):
     @TransactionDecorator('u2')
     def test_copr_build_non_submitter_cannot_cancel_build(self, f_users, f_coprs, f_builds, f_db):
         self.db.session.add_all([self.u1, self.c1, self.b1])
-        r = self.test_client.post('/coprs/detail/{0}/{1}/cancel_build/{2}/'.format(self.u1.name, self.c1.name, self.b1.id),
+        r = self.test_client.post('/coprs/{0}/{1}/cancel_build/{2}/'.format(self.u1.name, self.c1.name, self.b1.id),
                   data = {},
                   follow_redirects = True)
         self.db.session.add(self.b1)
-- 
1.8.3.1



More information about the copr-devel mailing list