Commit 45dc0805 authored by Nicolas Joyard's avatar Nicolas Joyard

Fix tests

parent bceac605
......@@ -131,8 +131,10 @@
"city": "Paris",
"name": "Assembl\u00e9e nationale",
"country": 1095,
"floor": "",
"number": "126",
"street": "Rue de l'Universit\u00e9",
"office_number": "",
"representative": 1,
"location": "",
"kind": "official",
......@@ -146,8 +148,10 @@
"city": "Lille",
"name": "Permanence",
"country": 1095,
"floor": "",
"number": "20",
"street": "Rue d'Arras",
"office_number": "",
"representative": 1,
"location": "",
"kind": "",
......@@ -161,8 +165,10 @@
"city": "Lille",
"name": "",
"country": 1095,
"floor": "",
"number": "",
"street": "",
"office_number": "",
"representative": 1,
"location": "",
"kind": "",
......@@ -176,8 +182,10 @@
"city": "Paris",
"name": "Palais du Luxembourg",
"country": 1095,
"floor": "",
"number": "15",
"street": "Rue de Vaugirard",
"office_number": "",
"representative": 2,
"location": "",
"kind": "official",
......@@ -275,13 +283,53 @@
{
"fields": {
"name": "Commission des lois constitutionnelles, de la l\u00e9gislation et de l'administration g\u00e9n\u00e9rale de la r\u00e9publique",
"kind": "comittee",
"kind": "committee",
"abbreviation": "AnComLois",
"chamber": 1
},
"model": "representatives.group",
"pk": 7
},
{
"fields": {
"name": "Bureau de l'assembl\u00e9e nationale",
"kind": "delegation",
"abbreviation": "",
"chamber": 1
},
"model": "representatives.group",
"pk": 8
},
{
"fields": {
"name": "D\u00e9l\u00e9gation charg\u00e9e de la communication et de la presse",
"kind": "delegation",
"abbreviation": "",
"chamber": 1
},
"model": "representatives.group",
"pk": 9
},
{
"fields": {
"name": "Groupe d'amiti\u00e9 france-mexique",
"kind": "delegation",
"abbreviation": "",
"chamber": 1
},
"model": "representatives.group",
"pk": 10
},
{
"fields": {
"name": "Groupe d'amiti\u00e9 france-argentine",
"kind": "delegation",
"abbreviation": "",
"chamber": 1
},
"model": "representatives.group",
"pk": 11
},
{
"fields": {
"name": "Socialiste et r\u00e9publicain",
......@@ -290,7 +338,7 @@
"chamber": 2
},
"model": "representatives.group",
"pk": 8
"pk": 12
},
{
"fields": {
......@@ -300,7 +348,7 @@
"chamber": null
},
"model": "representatives.group",
"pk": 9
"pk": 13
},
{
"fields": {
......@@ -310,17 +358,27 @@
"chamber": null
},
"model": "representatives.group",
"pk": 10
"pk": 14
},
{
"fields": {
"name": "Commission de la culture, de l'\u00e9ducation et de la communication",
"kind": "comittee",
"kind": "committee",
"abbreviation": "SenComCult",
"chamber": 2
},
"model": "representatives.group",
"pk": 11
"pk": 15
},
{
"fields": {
"name": "Groupe France-Japon",
"kind": "delegation",
"abbreviation": "",
"chamber": 2
},
"model": "representatives.group",
"pk": 16
},
{
"fields": {
......@@ -411,6 +469,58 @@
"model": "representatives.mandate",
"pk": 5
},
{
"fields": {
"group": 8,
"end_date": null,
"role": "questeur",
"representative": 1,
"link": "",
"begin_date": "2012-06-20",
"constituency": 1
},
"model": "representatives.mandate",
"pk": 6
},
{
"fields": {
"group": 9,
"end_date": null,
"role": "membre",
"representative": 1,
"link": "",
"begin_date": "2012-06-20",
"constituency": 1
},
"model": "representatives.mandate",
"pk": 7
},
{
"fields": {
"group": 10,
"end_date": null,
"role": "vice-pr\u00e9sident",
"representative": 1,
"link": "",
"begin_date": "2012-06-20",
"constituency": 1
},
"model": "representatives.mandate",
"pk": 8
},
{
"fields": {
"group": 11,
"end_date": null,
"role": "vice-pr\u00e9sident",
"representative": 1,
"link": "",
"begin_date": "2012-06-20",
"constituency": 1
},
"model": "representatives.mandate",
"pk": 9
},
{
"fields": {
"group": 3,
......@@ -422,11 +532,11 @@
"constituency": 3
},
"model": "representatives.mandate",
"pk": 6
"pk": 10
},
{
"fields": {
"group": 8,
"group": 12,
"end_date": null,
"role": "membre",
"representative": 2,
......@@ -435,11 +545,11 @@
"constituency": 2
},
"model": "representatives.mandate",
"pk": 7
"pk": 11
},
{
"fields": {
"group": 9,
"group": 13,
"end_date": null,
"role": "membre",
"representative": 2,
......@@ -448,11 +558,11 @@
"constituency": 2
},
"model": "representatives.mandate",
"pk": 8
"pk": 12
},
{
"fields": {
"group": 10,
"group": 14,
"end_date": null,
"role": "membre",
"representative": 2,
......@@ -461,11 +571,11 @@
"constituency": 2
},
"model": "representatives.mandate",
"pk": 9
"pk": 13
},
{
"fields": {
"group": 11,
"group": 15,
"end_date": null,
"role": "vice-pr\u00e9sident",
"representative": 2,
......@@ -474,6 +584,19 @@
"constituency": 2
},
"model": "representatives.mandate",
"pk": 10
"pk": 14
},
{
"fields": {
"group": 16,
"end_date": null,
"role": "pr\u00e9sident",
"representative": 2,
"link": "",
"begin_date": "2004-09-26",
"constituency": 2
},
"model": "representatives.mandate",
"pk": 15
}
]
......@@ -83,14 +83,14 @@ class RepresentativeList(RepresentativeViewMixin, generic.ListView):
# Search group based on pk
qs = qs.filter(
models.Q(mandates__end_date__gte=today) |
models.Q(mandates__end_date__isnull=True),
models.Q(mandates__end_date__isnull=True),
mandates__group_id=int(group),
)
else:
# Search group based on abbreviation
qs = qs.filter(
models.Q(mandates__end_date__gte=today) |
models.Q(mandates__end_date__isnull=True),
models.Q(mandates__end_date__isnull=True),
mandates__group__name=group,
mandates__group__kind=group_kind,
)
......@@ -131,7 +131,7 @@ class GroupList(generic.ListView):
def get_queryset(self):
qs = Group.objects.filter(
models.Q(mandates__end_date__gte=datetime.date.today()) |
models.Q(mandates__end_date__isnull=True)
models.Q(mandates__end_date__isnull=True)
)
kind = self.kwargs.get('kind', None)
......
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