diff --git a/memopol/tests/RepresentativeListTest/test_page1_paginateby12_displaylist_searchjoly.html b/memopol/tests/RepresentativeListTest/test_page1_paginateby12_displaylist_searchjoly.html deleted file mode 100644 index 2bc1c5946a4b2fc1b1bd111b558dabaec3b4934a..0000000000000000000000000000000000000000 --- a/memopol/tests/RepresentativeListTest/test_page1_paginateby12_displaylist_searchjoly.html +++ /dev/null @@ -1,188 +0,0 @@ -
- - - - -
- - - - -
- - -
- - -
- Number of results : 1 -
- Number of displayed results : - 12 - ( - - - 12 - - - / - - - - 24 - - - / - - - - 48 - - - / - - - - 96 - - - - ) - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - -
- Photo - - Name - - Country - - Group - - Score - -
- - - - - - - Eva JOLY - - - - France [FR] - - - - Greens/EFA - - - 15 - -
- - -
- - -
- Number of results : 1 -
- Number of displayed results : - 12 - ( - - - 12 - - - / - - - - 24 - - - / - - - - 48 - - - / - - - - 96 - - - - ) - - - - - - - - - - - - - -
-
- - diff --git a/memopol/tests/RepresentativeListTest/test_page1_paginateby12_displaylist.html b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist/content similarity index 74% rename from memopol/tests/RepresentativeListTest/test_page1_paginateby12_displaylist.html rename to memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist/content index 062f06780bfdff03691278e64721fe92fed16202..52bc54725a36530848ee06588fed49687e199c32 100644 --- a/memopol/tests/RepresentativeListTest/test_page1_paginateby12_displaylist.html +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist/content @@ -1,7 +1,80 @@ -
+ + + + + + + + + Home + - The Political Memory of + + + + + + + + + + + + + + + + + + + + + + diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly/content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly/content new file mode 100644 index 0000000000000000000000000000000000000000..d88608d79697a08612b5737b907f0e0393ce658a --- /dev/null +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_displaylist_searchjoly/content @@ -0,0 +1,287 @@ + + + + + + + + + Home + - The Political Memory of + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + +
+ + +
+ Number of results : 1 +
+ Number of displayed results : + 12 + ( + + + 12 + + + / + + + + 24 + + + / + + + + 48 + + + / + + + + 96 + + + + ) + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ Photo + + Name + + Country + + Group + + Score + +
+ + + + + + + Eva JOLY + + + + + France [FR] + + + + + Greens/EFA + + + 15 + +
+ + +
+ + +
+ Number of results : 1 +
+ Number of displayed results : + 12 + ( + + + 12 + + + / + + + + 24 + + + / + + + + 48 + + + / + + + + 96 + + + + ) + + + + + + + + + + + + + +
+
+ + + +
+ + + + + + diff --git a/memopol/tests/RepresentativeListTest/test_page1_paginateby24_displaygrid.html b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_displaygrid/content similarity index 83% rename from memopol/tests/RepresentativeListTest/test_page1_paginateby24_displaygrid.html rename to memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_displaygrid/content index 084289225fd5dc7efca1850b2e0d2235c8ee6159..5f0203ce0e42de6bb045350124117dbe8873fd9a 100644 --- a/memopol/tests/RepresentativeListTest/test_page1_paginateby24_displaygrid.html +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_displaygrid/content @@ -1,7 +1,80 @@ -
+ + + + + + + + + Home + - The Political Memory of + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + + + + diff --git a/memopol/tests/RepresentativeListTest/test_page2_paginateby12_displaylist.html b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist/content similarity index 75% rename from memopol/tests/RepresentativeListTest/test_page2_paginateby12_displaylist.html rename to memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist/content index 4f59ddf50a0f318be3e38ce771b15bf24ded933a..9737215355aeee49b56e07996947ad0af055a124 100644 --- a/memopol/tests/RepresentativeListTest/test_page2_paginateby12_displaylist.html +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist/content @@ -1,7 +1,80 @@ -
+ + + + + + + + + Home + - The Political Memory of + + + + + + + + + + + + + + + + + + + + + + diff --git a/memopol/tests/RepresentativeListTest/test_page2_paginateby24_displaylist.html b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist/content similarity index 74% rename from memopol/tests/RepresentativeListTest/test_page2_paginateby24_displaylist.html rename to memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist/content index b495b308d167664b0c04d2f72f433e574eee7d00..6ee36005948624931aca70a0e1974ed19b467fd6 100644 --- a/memopol/tests/RepresentativeListTest/test_page2_paginateby24_displaylist.html +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby24_displaylist/content @@ -1,7 +1,80 @@ -
+ + + + + + + + + Home + - The Political Memory of + + + + + + + + + + + + + + + + + + + + + + diff --git a/memopol/tests/test_representatives_list.py b/memopol/tests/test_representatives_list.py index 20938611e5a2796cffd4438537ac3bd947699cab..f4f3cbb952c2b39e82b96f8b03a61aadced8c235 100644 --- a/memopol/tests/test_representatives_list.py +++ b/memopol/tests/test_representatives_list.py @@ -1,6 +1,8 @@ # -*- coding: utf8 -*- from django.test import TestCase +from responsediff.response import Response + from .base import UrlGetTestMixin @@ -23,7 +25,8 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase): """ self.response = self.client.get(url) - self.assertExpectedHtmlInResult() + expected = Response.for_test(self) + expected.assertNoDiff(self.response) def test_page1_paginateby12_displaylist(self): self.functional_test(1, 12, 'list') diff --git a/setup.py b/setup.py index bcd06ab4f5d46e7f37e0954fa8dc41fcd823fd7b..3ef3b72f54a2deec45503c8e33d4adb7d9d74ae0 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup(name='political-memory', 'django-compressor>=1.6,<1.7', 'django-datetime-widget>=0.9,<1.0', 'django-filter>=0.11,<0.12', - 'django-representatives>=0.0.6', + 'django-representatives>=0.0.9', 'django-representatives-votes>=0.0.7', 'django-taggit>=0.17,<0.18', 'django>=1.8,<1.9', @@ -28,6 +28,7 @@ setup(name='political-memory', ], extras_require={ 'testing': [ + 'django-responsediff', 'flake8', 'pep8', 'pytest', diff --git a/templates/representatives/_representative_block.haml b/templates/representatives/_representative_block.haml index 34f68f267c5663783873bd2cbc79993c24fdb4ef..ecdc69bc59812b3e1b76aa84b946c0cfbca0925b 100644 --- a/templates/representatives/_representative_block.haml +++ b/templates/representatives/_representative_block.haml @@ -21,7 +21,8 @@ %tr %th Country %td< - = representative.country|country_flag + %a{:href => "{{ representative.country.get_absolute_url }}"} + = representative.country|country_flag %tr %th Party %td< diff --git a/templates/representatives/representative_grid.haml b/templates/representatives/representative_grid.haml index e01ded074062dae399df569fd33580fa1ee5b1f2..d8c1dddb08b65e5bfb3f80f2a711f2e22e3df870 100644 --- a/templates/representatives/representative_grid.haml +++ b/templates/representatives/representative_grid.haml @@ -16,7 +16,7 @@ %a{'href': "{{ representative.get_absolute_url }}"} = representative.full_name %li.country - %a{'href': "{% url 'representatives:representative-list' group_kind='country' group=representative.country.code %}"} + %a{'href': "{{ representative.country.get_absolute_url }}"} = representative.country|country_flag %li.mandate %a{'href': "{{ representative.main_mandate.group.get_absolute_url }}"} diff --git a/templates/representatives/representative_list.haml b/templates/representatives/representative_list.haml index 7d73d499204e48e352583fc9a85464f4f896f7c7..4288114df4f021a5cda06d86bc5006f8b2585713 100644 --- a/templates/representatives/representative_list.haml +++ b/templates/representatives/representative_list.haml @@ -42,6 +42,7 @@ = representative.full_name %td + %a{'href': "{{ representative.country.get_absolute_url }}"} = representative.country %td