Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : bkabrda-workspace
---------------------------------------------------------------
commit b2b2415a44dfc6428cf9638070afa64729351156
Author: Bohuslav Kabrda <bkabrda(a)redhat.com>
Date: Wed Nov 21 09:13:39 2012 +0100
Some tests for the copr detail
---------------------------------------------------------------
.../tests/test_views/test_coprs_ns/test_general.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
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 c42b097..f995b7c 100644
--- a/wsgi/tests/test_views/test_coprs_ns/test_general.py
+++ b/wsgi/tests/test_views/test_coprs_ns/test_general.py
@@ -85,3 +85,17 @@ class TestCoprNew(CoprsTestCase):
r = c.post('/coprs/new/', data = {'name': 'foocopr',
'release': 'fedora-rawhide', 'arches': ['i386']},
follow_redirects = True)
assert len(self.models.Copr.query.filter(self.models.Copr.name ==
'foocopr').all()) == foocoprs
assert "You already have copr named" in r.data
+
+class TestCoprDetail(CoprsTestCase):
+ def test_copr_detail_not_found(self):
+ r = self.tc.get('/coprs/detail/foo/bar/')
+ assert r.status_code == 404
+
+ def test_copr_detail_normal(self, f_users, f_coprs):
+ r = self.tc.get('/coprs/detail/{0}/{1}/'.format(self.u1.name,
self.c1.name))
+ assert r.status_code == 200
+ assert r.data.find(self.c1.name) != -1
+
+ def test_copr_detail_contains_builds(self, f_users, f_coprs, f_builds):
+ r = self.tc.get('/coprs/detail/{0}/{1}/'.format(self.u1.name,
self.c1.name))
+ assert r.data.count('<tr class=build') == 2