Commit 3944388c authored by Nicolas Joyard's avatar Nicolas Joyard

Update tests

parent 03e2b3e3
[
{
"fields" : {
"abbreviation": "AN",
"country": 1095,
"name": "Assembl\u00e9e nationale"
},
"model": "representatives.chamber",
"pk": 2
},
{
"fields": {
"abbreviation": "SEN",
"country": 1095,
"name": "S\u00e9nat"
},
"model": "representatives.chamber",
"pk": 3
},
{
"fields": {
"updated": "2016-02-14T13:16:31.417Z",
"reference": "http://www.assemblee-nationale.fr/14/dossiers/liberte_maires_rythmes_scolaires_premier_degre.asp",
"title": "Education : libre choix des maires concernant les rythmes scolaires dans le premier degr\u00e9",
"text": "",
"created": "2016-02-14T13:16:31.417Z",
"link": "http://www.assemblee-nationale.fr/14/dossiers/liberte_maires_rythmes_scolaires_premier_degre.asp",
"ext_link": ""
"updated": "2016-07-07T20:23:24.303Z",
"title": "Education : libre choix des maires concernant les rythmes scolaires dans le premier degr\u00e9",
"reference": "14/liberte_maires_rythmes_scolaires_premier_degre",
"created": "2016-07-07T20:23:24.302Z"
},
"model": "representatives_votes.dossier",
"pk": 1
},
{
"fields": {
"updated": "2016-02-14T13:16:31.428Z",
"reference": "http://www.assemblee-nationale.fr/14/dossiers/action_publique_territoriale_metropoles.asp",
"title": "Collectivit\u00e9s territoriales : action publique territoriale et m\u00e9tropoles",
"text": "",
"created": "2016-02-14T13:16:31.428Z",
"link": "http://www.assemblee-nationale.fr/14/dossiers/action_publique_territoriale_metropoles.asp",
"ext_link": "http://www.senat.fr/dossier-legislatif/pjl12-495.html"
"updated": "2016-07-07T20:23:24.365Z",
"title": "Collectivit\u00e9s territoriales : action publique territoriale et m\u00e9tropoles",
"reference": "14/action_publique_territoriale_metropoles",
"created": "2016-07-07T20:23:24.332Z"
},
"model": "representatives_votes.dossier",
"pk": 2
},
{
"fields": {
"updated": "2016-02-21T14:34:35.721Z",
"reference": "http://www.senat.fr/dossier-legislatif/ppl13-799.html",
"title": "Protection de l'enfant",
"text": "",
"created": "2016-02-21T14:34:35.721Z",
"link": "http://www.senat.fr/dossier-legislatif/ppl13-799.html",
"ext_link": ""
"updated": "2016-07-07T20:23:24.410Z",
"title": "Protection de l'enfant",
"reference": "ppl13-799",
"created": "2016-07-07T20:23:24.410Z"
},
"model": "representatives_votes.dossier",
"pk": 3
},
{
"fields": {
"updated": "2016-07-07T20:23:24.307Z",
"title": "",
"dossier": 1,
"created": "2016-07-07T20:23:24.307Z",
"kind": "procedure-file",
"chamber": 2,
"link": "http://www.assemblee-nationale.fr/14/dossiers/liberte_maires_rythmes_scolaires_premier_degre.asp"
},
"model": "representatives_votes.document",
"pk": 1
},
{
"fields": {
"updated": "2016-07-07T20:23:24.335Z",
"title": "",
"dossier": 2,
"created": "2016-07-07T20:23:24.335Z",
"kind": "procedure-file",
"chamber": 3,
"link": "http://www.senat.fr/dossier-legislatif/pjl12-495.html"
},
"model": "representatives_votes.document",
"pk": 2
},
{
"fields": {
"updated": "2016-07-07T20:23:24.371Z",
"title": "",
"dossier": 2,
"created": "2016-07-07T20:23:24.371Z",
"kind": "procedure-file",
"chamber": 2,
"link": "http://www.assemblee-nationale.fr/14/dossiers/action_publique_territoriale_metropoles.asp"
},
"model": "representatives_votes.document",
"pk": 3
},
{
"fields": {
"updated": "2016-07-07T20:23:24.415Z",
"title": "",
"dossier": 3,
"created": "2016-07-07T20:23:24.415Z",
"kind": "procedure-file",
"chamber": 3,
"link": "http://www.senat.fr/dossier-legislatif/ppl13-799.html"
},
"model": "representatives_votes.document",
"pk": 4
}
]
[
{
"fields": {
"updated": "2015-12-13T10:11:31.369Z",
"reference": "2012/2002(INI)",
"title": "Agenda for change: the future of EU development policy",
"text": "",
"created": "2015-12-13T10:11:31.369Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)"
"updated": "2016-07-08T05:17:40.580Z",
"title": "Agenda for change: the future of EU development policy",
"reference": "2012/2002(INI)",
"created": "2016-07-08T05:17:40.580Z"
},
"model": "representatives_votes.dossier",
"pk": 1
},
{
"fields": {
"updated": "2015-12-13T10:11:31.378Z",
"reference": "2015/2132(BUD)",
"title": "2016 general budget: all sections",
"text": "",
"created": "2015-12-13T10:11:31.378Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
"updated": "2016-07-08T05:17:40.617Z",
"title": "2016 general budget: all sections",
"reference": "2015/2132(BUD)",
"created": "2016-07-08T05:17:40.616Z"
},
"model": "representatives_votes.dossier",
"pk": 2
},
{
"fields": {
"updated": "2015-12-13T10:11:31.388Z",
"reference": "2013/2857(DEA)",
"title": "Scheme of control and enforcement applicable in the area covered by the Convention on future multilateral cooperation in the North-East Atlantic fisheries",
"text": "",
"created": "2015-12-13T10:11:31.388Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2013/2857(DEA)"
"updated": "2016-07-08T05:17:40.644Z",
"title": "Scheme of control and enforcement applicable in the area covered by the Convention on future multilateral cooperation in the North-East Atlantic fisheries",
"reference": "2013/2857(DEA)",
"created": "2016-07-08T05:17:40.644Z"
},
"model": "representatives_votes.dossier",
"pk": 3
},
{
"fields": {
"updated": "2015-12-13T10:11:31.398Z",
"reference": "2015/2623(DEA)",
"title": "Scheme of control and enforcement applicable in the area covered by the Convention on future multilateral cooperation in the North-East Atlantic fisheries",
"text": "",
"created": "2015-12-13T10:11:31.398Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2623(DEA)"
"updated": "2016-07-08T05:17:40.682Z",
"title": "Scheme of control and enforcement applicable in the area covered by the Convention on future multilateral cooperation in the North-East Atlantic fisheries",
"reference": "2015/2623(DEA)",
"created": "2016-07-08T05:17:40.682Z"
},
"model": "representatives_votes.dossier",
"pk": 4
},
{
"fields": {
"updated": "2015-12-13T10:11:31.408Z",
"reference": "2009/0051(COD)",
"title": "Scheme of control and enforcement applicable in the area covered by the Convention on future multilateral cooperation in the North-East Atlantic fisheries",
"text": "",
"created": "2015-12-13T10:11:31.408Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2009/0051(COD)"
"updated": "2016-07-08T05:17:40.719Z",
"title": "Scheme of control and enforcement applicable in the area covered by the Convention on future multilateral cooperation in the North-East Atlantic fisheries",
"reference": "2009/0051(COD)",
"created": "2016-07-08T05:17:40.719Z"
},
"model": "representatives_votes.dossier",
"pk": 5
},
{
"fields": {
"updated": "2016-07-08T05:17:40.582Z",
"title": "",
"dossier": 1,
"created": "2016-07-08T05:17:40.582Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)"
},
"model": "representatives_votes.document",
"pk": 1
},
{
"fields": {
"updated": "2016-07-08T05:17:40.619Z",
"title": "",
"dossier": 2,
"created": "2016-07-08T05:17:40.619Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
},
"model": "representatives_votes.document",
"pk": 2
},
{
"fields": {
"updated": "2016-07-08T05:17:40.646Z",
"title": "",
"dossier": 3,
"created": "2016-07-08T05:17:40.646Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2013/2857(DEA)"
},
"model": "representatives_votes.document",
"pk": 3
},
{
"fields": {
"updated": "2016-07-08T05:17:40.684Z",
"title": "",
"dossier": 4,
"created": "2016-07-08T05:17:40.684Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2623(DEA)"
},
"model": "representatives_votes.document",
"pk": 4
},
{
"fields": {
"updated": "2016-07-08T05:17:40.724Z",
"title": "",
"dossier": 5,
"created": "2016-07-08T05:17:40.724Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2009/0051(COD)"
},
"model": "representatives_votes.document",
"pk": 5
}
]
[
{
"fields": {
"updated": "2015-12-13T10:11:31.378Z",
"reference": "2015/2132(BUD)",
"title": "2016 general budget: all sections",
"text": "",
"created": "2015-12-13T10:11:31.378Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
"updated": "2016-07-08T05:20:11.662Z",
"title": "2016 general budget: all sections",
"reference": "2015/2132(BUD)",
"created": "2016-07-08T05:20:11.662Z"
},
"model": "representatives_votes.dossier",
"pk": 1
},
{
"fields": {
"updated": "2016-07-08T05:20:11.664Z",
"title": "",
"dossier": 1,
"created": "2016-07-08T05:20:11.664Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
},
"model": "representatives_votes.document",
"pk": 1
},
{
"fields": {
"updated": "2016-07-08T05:21:34.553Z",
"total_for": 1,
"description": "",
"reference": "A8-0298/2015",
"title": "A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 29",
"dossier": 1,
"created": "2016-07-08T05:20:11.696Z",
"kind": "Am 29",
"datetime": "2015-10-28T12:00:12Z",
"total_against": 1,
"total_abstain": 0
},
"model": "representatives_votes.proposal",
"pk": 1
},
{
"fields": {
"representative_name": "",
......@@ -19,7 +48,7 @@
"representative": 1
},
"model": "representatives_votes.vote",
"pk": 2
"pk": 1
},
{
"fields": {
......@@ -29,6 +58,6 @@
"representative": 2
},
"model": "representatives_votes.vote",
"pk": 3
"pk": 2
}
]
......@@ -66,4 +66,4 @@
"url": "http://www.europarl.europa.eu/RegData/seance_pleniere/proces_verbal/2015/10-28/votes_nominaux/xml/P8_PV(2015)10-28(RCV)_XC.xml",
"voteid": "59146"
}
}
}
\ No newline at end of file
......@@ -5,8 +5,7 @@
"reference": "2012/2002(INI)",
"title": "Agenda for change: the future of EU development policy",
"text": "",
"created": "2015-12-13T10:11:31.369Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)"
"created": "2015-12-13T10:11:31.369Z"
},
"model": "representatives_votes.dossier",
"pk": 1
......
......@@ -5,8 +5,7 @@
"reference": "2012/2002(INI)",
"title": "initial title",
"text": "",
"created": "2015-12-13T10:11:31.369Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)"
"created": "2015-12-13T10:11:31.369Z"
},
"model": "representatives_votes.dossier",
"pk": 1
......
......@@ -64,7 +64,7 @@ class DossierTest(TestCase):
representatives.__path__[0]), 'fixtures',
'representatives_test.json'))
with self.assertNumQueries(15):
with self.assertNumQueries(22):
_test_import('single', import_dossiers.import_single)
def test_parltrack_sync_dossier(self):
......@@ -87,7 +87,7 @@ class DossierTest(TestCase):
with open(mock_file, 'r') as mock_stream:
urlopen.return_value = mock_stream
with self.assertNumQueries(3):
with self.assertNumQueries(8):
_test_import('sync', callback)
urlopen.assert_called_with(expected_url)
......@@ -17,8 +17,7 @@
"reference": "2015/2132(BUD)",
"title": "2016 general budget: all sections",
"text": "",
"created": "2015-12-13T01:10:09.698Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
"created": "2015-12-13T01:10:09.698Z"
},
"model": "representatives_votes.dossier",
"pk": 65
......
......@@ -5,8 +5,7 @@
"reference": "2012/2002(INI)",
"title": "Agenda for change: the future of EU development policy",
"text": "",
"created": "2015-12-27T11:51:14.770Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)"
"created": "2015-12-27T11:51:14.770Z"
},
"model": "representatives_votes.dossier",
"pk": 1
......@@ -17,12 +16,37 @@
"reference": "2015/2132(BUD)",
"title": "2016 general budget: all sections",
"text": "",
"created": "2015-12-27T11:51:14.781Z",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
"created": "2015-12-27T11:51:14.781Z"
},
"model": "representatives_votes.dossier",
"pk": 2
},
{
"fields": {
"updated": "2016-07-08T05:20:11.664Z",
"title": "",
"dossier": 1,
"created": "2016-07-08T05:20:11.664Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)"
},
"model": "representatives_votes.document",
"pk": 1
},
{
"fields": {
"updated": "2016-07-08T05:20:11.664Z",
"title": "",
"dossier": 2,
"created": "2016-07-08T05:20:11.664Z",
"kind": "procedure-file",
"chamber": 1,
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
},
"model": "representatives_votes.document",
"pk": 2
},
{
"fields": {
"updated": "2015-12-27T11:51:24.327Z",
......
......@@ -26,11 +26,17 @@
"url": "http://testserver/api/proposals/2/"
}
],
"documents": [
{
"dossier": "http://testserver/api/dossiers/1/",
"chamber": "http://testserver/api/chambers/1/",
"kind": "procedure-file",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)"
}
],
"created": "2015-12-27T11:51:14.770000Z",
"updated": "2015-12-27T11:51:14.770000Z",
"title": "Agenda for change: the future of EU development policy",
"reference": "2012/2002(INI)",
"text": "",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)",
"ext_link": ""
"text": ""
}
\ No newline at end of file
......@@ -3,14 +3,12 @@
"title": "Agenda for change: the future of EU development policy",
"reference": "2012/2002(INI)",
"text": "",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2012/2002(INI)",
"url": "http://testserver/api/dossiers/1/"
},
{
"title": "2016 general budget: all sections",
"reference": "2015/2132(BUD)",
"text": "",
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)",
"url": "http://testserver/api/dossiers/2/"
}
]
\ No newline at end of file
......@@ -15,8 +15,10 @@ class RepresentativeManagerTest(test.TestCase):
Response.for_test(self).assertNoDiff(result)
def test_dossier(self):
# One for dossier + 1 for proposals
self.functional_test(2, '/api/dossiers/1/')
# One for dossier
# One for proposals
# One for documents
self.functional_test(3, '/api/dossiers/1/')
def test_dossiers(self):
self.functional_test(1, '/api/dossiers/')
......
......@@ -9,6 +9,7 @@ from representatives_votes.api import (
)
from representatives.api import (
ChamberViewSet,
ConstituencyViewSet,
GroupViewSet,
MandateViewSet,
......@@ -16,6 +17,7 @@ from representatives.api import (
)
router = routers.DefaultRouter()
router.register(r'chambers', ChamberViewSet)
router.register(r'constituencies', ConstituencyViewSet)
router.register(r'groups', GroupViewSet)
router.register(r'mandates', MandateViewSet)
......
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