Commit 9e4aee12 authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Update tests

parent 39750e91
...@@ -942,12 +942,24 @@ ...@@ -942,12 +942,24 @@
"reference": "2010/2935(RSP)", "reference": "2010/2935(RSP)",
"title": "Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)", "title": "Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)",
"text": "", "text": "",
"created": "2015-12-27T17:40:18.700Z", "created": "2015-12-27T17:40:18.700Z"
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2010/2935(RSP)"
}, },
"model": "representatives_votes.dossier", "model": "representatives_votes.dossier",
"pk": 28147 "pk": 28147
}, },
{
"fields": {
"updated": "2015-12-27T17:40:18.700Z",
"created": "2015-12-27T17:40:18.700Z",
"title": "",
"kind": "procedure-file",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2010/2935(RSP)",
"dossier": 28147,
"chamber": 1
},
"model": "representatives_votes.document",
"pk": 1
},
{ {
"fields": { "fields": {
"updated": "2015-12-27T18:03:52.645Z", "updated": "2015-12-27T18:03:52.645Z",
...@@ -1092,13 +1104,13 @@ ...@@ -1092,13 +1104,13 @@
"app_label": "representatives_positions" "app_label": "representatives_positions"
}, },
"model": "contenttypes.contenttype", "model": "contenttypes.contenttype",
"pk": 28 "pk": 29
}, },
{ {
"fields": { "fields": {
"tag": 1, "tag": 1,
"object_id": 1, "object_id": 1,
"content_type": 28 "content_type": 29
}, },
"model": "taggit.taggeditem", "model": "taggit.taggeditem",
"pk": 1 "pk": 1
...@@ -1107,7 +1119,7 @@ ...@@ -1107,7 +1119,7 @@
"fields": { "fields": {
"tag": 2, "tag": 2,
"object_id": 1, "object_id": 1,
"content_type": 28 "content_type": 29
}, },
"model": "taggit.taggeditem", "model": "taggit.taggeditem",
"pk": 2 "pk": 2
...@@ -1116,7 +1128,7 @@ ...@@ -1116,7 +1128,7 @@
"fields": { "fields": {
"tag": 1, "tag": 1,
"object_id": 3, "object_id": 3,
"content_type": 28 "content_type": 29
}, },
"model": "taggit.taggeditem", "model": "taggit.taggeditem",
"pk": 5 "pk": 5
...@@ -1125,7 +1137,7 @@ ...@@ -1125,7 +1137,7 @@
"fields": { "fields": {
"tag": 1, "tag": 1,
"object_id": 2, "object_id": 2,
"content_type": 28 "content_type": 29
}, },
"model": "taggit.taggeditem", "model": "taggit.taggeditem",
"pk": 6 "pk": 6
...@@ -1134,7 +1146,7 @@ ...@@ -1134,7 +1146,7 @@
"fields": { "fields": {
"tag": 3, "tag": 3,
"object_id": 2, "object_id": 2,
"content_type": 28 "content_type": 29
}, },
"model": "taggit.taggeditem", "model": "taggit.taggeditem",
"pk": 7 "pk": 7
......
...@@ -21679,12 +21679,24 @@ ...@@ -21679,12 +21679,24 @@
"reference": "2010/2935(RSP)", "reference": "2010/2935(RSP)",
"title": "Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)", "title": "Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)",
"text": "", "text": "",
"created": "2015-12-27T17:40:18.700Z", "created": "2015-12-27T17:40:18.700Z"
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2010/2935(RSP)"
}, },
"model": "representatives_votes.dossier", "model": "representatives_votes.dossier",
"pk": 28147 "pk": 28147
}, },
{
"fields": {
"updated": "2015-12-27T17:40:18.700Z",
"created": "2015-12-27T17:40:18.700Z",
"title": "",
"kind": "procedure-file",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2010/2935(RSP)",
"dossier": 28147,
"chamber": 1
},
"model": "representatives_votes.document",
"pk": 1
},
{ {
"fields": { "fields": {
"updated": "2015-12-27T18:03:52.645Z", "updated": "2015-12-27T18:03:52.645Z",
......
...@@ -84,6 +84,44 @@ ...@@ -84,6 +84,44 @@
<strong>2010/2935(RSP)</strong> <strong>2010/2935(RSP)</strong>
</p> </p>
<h2>
Documents
</h2>
<table class='table'>
<tr>
<th>
Chamber
</th>
<th>
Document type
</th>
<th>
Title
</th>
</tr>
<tr>
<td>
<span class="chamber-icon chamber-icon-ep"></span> European Parliament
</td>
<td>
<a class='external' href='http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2010/2935(RSP)' target='_blank'>
Procedure file
</a>
</td>
<td>
<a class='external' href='http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2010/2935(RSP)' target='_blank'>
</a>
</td>
</tr>
</table>
<h2> <h2>
Recommendations Recommendations
......
...@@ -91,6 +91,11 @@ ...@@ -91,6 +91,11 @@
<form class='filter-form' action='/votes/dossier/' method='get'> <form class='filter-form' action='/votes/dossier/' method='get'>
<div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" /><span class="help-block">Filter
</span></div>
<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter">
<option value="" selected="selected">---------</option>
<option value="1">European Parliament [EP]</option>
</select><span class="help-block">Filter
</span></div> </span></div>
<div class="form-group"> <div class="form-group">
...@@ -164,6 +169,9 @@ ...@@ -164,6 +169,9 @@
</h1> </h1>
<table class='table'> <table class='table'>
<tr> <tr>
<th>
Chambers
</th>
<th> <th>
Title Title
</th> </th>
...@@ -180,6 +188,11 @@ ...@@ -180,6 +188,11 @@
</tr> </tr>
<tr> <tr>
<td>
<span class="chamber-icon chamber-icon-ep" title="European Parliament"></span>
</td>
<td> <td>
<a href='/votes/dossier/28147/'> <a href='/votes/dossier/28147/'>
Resolution on the Anti-Counterfeiting Trade Agreement (ACTA) Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)
......
...@@ -91,6 +91,11 @@ ...@@ -91,6 +91,11 @@
<form class='filter-form' action='/votes/dossier/' method='get'> <form class='filter-form' action='/votes/dossier/' method='get'>
<div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="acta" /><span class="help-block">Filter <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="acta" /><span class="help-block">Filter
</span></div>
<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter">
<option value="" selected="selected">---------</option>
<option value="1">European Parliament [EP]</option>
</select><span class="help-block">Filter
</span></div> </span></div>
<div class="form-group"> <div class="form-group">
...@@ -164,6 +169,9 @@ ...@@ -164,6 +169,9 @@
</h1> </h1>
<table class='table'> <table class='table'>
<tr> <tr>
<th>
Chambers
</th>
<th> <th>
Title Title
</th> </th>
...@@ -180,6 +188,11 @@ ...@@ -180,6 +188,11 @@
</tr> </tr>
<tr> <tr>
<td>
<span class="chamber-icon chamber-icon-ep" title="European Parliament"></span>
</td>
<td> <td>
<a href='/votes/dossier/28147/'> <a href='/votes/dossier/28147/'>
Resolution on the Anti-Counterfeiting Trade Agreement (ACTA) Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)
......
...@@ -91,6 +91,11 @@ ...@@ -91,6 +91,11 @@
<form class='filter-form' action='/votes/dossier/' method='get'> <form class='filter-form' action='/votes/dossier/' method='get'>
<div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="no-dossier-will-have-that-title-ever" /><span class="help-block">Filter <div class="form-group has-success"><label class="control-label" for="id_search">Search</label><input class="form-control" id="id_search" name="search" placeholder="Search" title="Filter" type="text" value="no-dossier-will-have-that-title-ever" /><span class="help-block">Filter
</span></div>
<div class="form-group has-success"><label class="control-label" for="id_chamber">Chamber</label><select class="form-control" id="id_chamber" name="chamber" title="Filter">
<option value="" selected="selected">---------</option>
<option value="1">European Parliament [EP]</option>
</select><span class="help-block">Filter
</span></div> </span></div>
<div class="form-group"> <div class="form-group">
......
...@@ -14,31 +14,38 @@ class DossiersTest(ResponseDiffMixin, TestCase): ...@@ -14,31 +14,38 @@ class DossiersTest(ResponseDiffMixin, TestCase):
# session setup # session setup
self.client.get('/votes/dossier/') self.client.get('/votes/dossier/')
# 1 query for chamber list (search form)
# 1 query for dossier count # 1 query for dossier count
# 1 query for dossiers # 1 query for dossiers
# 1 query for proposals # 1 query for proposals
# 1 query for recommendations # 1 query for recommendations
self.responsediff_test('/votes/dossier/', 4) # 1 query for documents
# 1 query for document chambers
self.responsediff_test('/votes/dossier/', 7)
def test_dossier_search(self): def test_dossier_search(self):
# session setup # session setup
self.client.get('/votes/dossier/') self.client.get('/votes/dossier/')
# 1 query for chamber list (search form)
# 1 query for dossier count # 1 query for dossier count
# 1 query for dossiers # 1 query for dossiers
# 1 query for proposals # 1 query for proposals
# 1 query for recommendations # 1 query for recommendations
# 1 query for documents
# 1 query for document chambers
q = 'acta' q = 'acta'
self.responsediff_test('/votes/dossier/?search=%s' % q, 4) self.responsediff_test('/votes/dossier/?search=%s' % q, 7)
def test_dossier_search_noresults(self): def test_dossier_search_noresults(self):
# session setup # session setup
self.client.get('/votes/dossier/') self.client.get('/votes/dossier/')
# 1 query for chamber list (search form)
# 1 query for dossier count # 1 query for dossier count
# nothing else since count = 0 # nothing else since count = 0
q = 'no-dossier-will-have-that-title-ever' q = 'no-dossier-will-have-that-title-ever'
self.responsediff_test('/votes/dossier/?search=%s' % q, 1) self.responsediff_test('/votes/dossier/?search=%s' % q, 2)
def test_dossier_detail(self): def test_dossier_detail(self):
# Get 1st dossier in dataset # Get 1st dossier in dataset
...@@ -50,4 +57,6 @@ class DossiersTest(ResponseDiffMixin, TestCase): ...@@ -50,4 +57,6 @@ class DossiersTest(ResponseDiffMixin, TestCase):
# 1 query for the dossier # 1 query for the dossier
# 1 query for proposals # 1 query for proposals
# 1 query for recommendations # 1 query for recommendations
self.responsediff_test('/votes/dossier/%s/' % dossier.pk, 3) # 1 query for documents
# 1 query for document chambers
self.responsediff_test('/votes/dossier/%s/' % dossier.pk, 5)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment