Permalink
Browse files

update tests after modifying index and distro_doc views

  • Loading branch information...
mapleoin committed Sep 19, 2012
1 parent ac34034 commit bd662830a3e0e7b7fdd3362bdc8b640e1e4e7c1c
Showing with 12 additions and 17 deletions.
  1. +12 −17 popcorn/test/test_views.py
View
@@ -109,23 +109,6 @@ def test_index_json(self):
self.assertEqual(json.loads(response.data), {
"submissions_distrover": u'[["openSUSE 12.1", 1]]',
"distro_packages": "[[\"openSUSE\", 1285]]",
- "vendors": [{
- "vendor_name": "openSUSE",
- "vendor_url": "openSUSE"
- }],
- "distros": [{
- "distro_name": "openSUSE",
- "submissions": [{
- "sub_id": 1,
- "sub_date": today.strftime("%Y-%m-%d"),
- "distro_version": "12.1",
- "popcorn_version": "0.1",
- "distro_name": "openSUSE",
- "arch": "x86_64"
- }],
- "distro_version": "12.1",
- "distro_name": "openSUSE"
- }]
})
self.assertEqual(response.headers['Content-Type'],
'application/json')
@@ -217,3 +200,15 @@ def test_distro_json(self):
})
self.assertEqual(response.headers['Content-Type'],
'application/json')
+
+ def test_distro_doc_json(self):
+ self.submit(compress=False, header=False)
+ with app.test_request_context(
+ path='/distro', method='GET',
+ headers=[('Accept', 'application/json')]):
+ response = app.dispatch_request()
+ self.assertEqual(json.loads(response.data), {
+ "submissions_distrover": u'[["openSUSE 12.1", 1]]',
+ })
+ self.assertEqual(response.headers['Content-Type'],
+ 'application/json')

0 comments on commit bd66283

Please sign in to comment.