Commit f3eabc18 authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Fix more tests :)

parent e03f7bc8
...@@ -2,22 +2,21 @@ ...@@ -2,22 +2,21 @@
{ {
"fields": { "fields": {
"text": "", "text": "",
"updated": "2016-07-08T05:20:11.662Z",
"title": "2016 general budget: all sections", "title": "2016 general budget: all sections",
"reference": "2015/2132(BUD)", "reference": "2015/2132(BUD)"
"created": "2016-07-08T05:20:11.662Z"
}, },
"model": "representatives_votes.dossier", "model": "representatives_votes.dossier"
"pk": 1
}, },
{ {
"fields": { "fields": {
"updated": "2016-07-08T05:20:11.664Z",
"title": "", "title": "",
"dossier": 1, "dossier": [
"created": "2016-07-08T05:20:11.664Z", "2015/2132(BUD)"
],
"kind": "procedure-file", "kind": "procedure-file",
"chamber": 1, "chamber": [
"EP"
],
"link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)" "link": "http://www.europarl.europa.eu/oeil/popups/ficheprocedure.do?reference=2015/2132(BUD)"
}, },
"model": "representatives_votes.document", "model": "representatives_votes.document",
...@@ -25,27 +24,31 @@ ...@@ -25,27 +24,31 @@
}, },
{ {
"fields": { "fields": {
"updated": "2016-07-08T05:21:34.553Z",
"total_for": 1, "total_for": 1,
"description": "", "description": "",
"reference": "A8-0298/2015", "reference": "A8-0298/2015",
"title": "A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 29", "title": "A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 29",
"dossier": 1, "dossier": [
"created": "2016-07-08T05:20:11.696Z", "2015/2132(BUD)"
],
"kind": "Am 29", "kind": "Am 29",
"datetime": "2015-10-28T12:00:12Z", "datetime": "2015-10-28T12:00:12Z",
"total_against": 1, "total_against": 1,
"total_abstain": 0 "total_abstain": 0
}, },
"model": "representatives_votes.proposal", "model": "representatives_votes.proposal"
"pk": 1
}, },
{ {
"fields": { "fields": {
"representative_name": "", "representative_name": "",
"position": "for", "position": "for",
"proposal": 1, "proposal": [
"representative": 1 "A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 29",
"2015/2132(BUD)"
],
"representative": [
"hubert-pirker-1948-10-03"
]
}, },
"model": "representatives_votes.vote", "model": "representatives_votes.vote",
"pk": 1 "pk": 1
...@@ -54,8 +57,13 @@ ...@@ -54,8 +57,13 @@
"fields": { "fields": {
"representative_name": "", "representative_name": "",
"position": "against", "position": "against",
"proposal": 1, "proposal": [
"representative": 2 "A8-0298/2015 - Jos\u00e9 Manuel Fernandes et G\u00e9rard Deprez - Am 29",
"2015/2132(BUD)"
],
"representative": [
"olle-ludvigsson-1948-10-28"
]
}, },
"model": "representatives_votes.vote", "model": "representatives_votes.vote",
"pk": 2 "pk": 2
......
...@@ -45,8 +45,11 @@ class ParltrackVotesTest(TestBase): ...@@ -45,8 +45,11 @@ class ParltrackVotesTest(TestBase):
representatives.__path__[0]), 'fixtures', representatives.__path__[0]), 'fixtures',
'representatives_test.json')) 'representatives_test.json'))
with self.assertNumQueries(22): with mock.patch('representatives_votes.contrib.parltrack.import_votes'
self._test_import('single', import_dossiers.import_single) '.Command.should_skip') as should_skip:
should_skip.return_value = False
with self.assertNumQueries(35):
self._test_import('single', import_dossiers.import_single)
def test_parltrack_sync_dossier(self): def test_parltrack_sync_dossier(self):
for model in (Representative, Dossier, Proposal, Vote): for model in (Representative, Dossier, Proposal, Vote):
......
Supports Markdown
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