diff --git a/.travis.yml b/.travis.yml index 0af10e8503768a5d09ed752d11b3fdfada033cc0..b08b436c98c3864093d866e886b3f4ead5c1bc53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,25 @@ sudo: false env: -- DJANGO_DEBUG=True DJANGO_SETTINGS_MODULE=memopol.settings + global: + - DJANGO_DEBUG=True + - DJANGO_SETTINGS_MODULE=memopol.settings + - MEMOPOL_DB_NAME=memopol + - MEMOPOL_DB_USER=memopol + - MEMOPOL_DB_PASSWORD=memopol + - MEMOPOL_DB_HOST=localhost + - MEMOPOL_DB_PORT=5432 + - MEMOPOL_DB_ENGINE=django.db.backends.postgresql_psycopg2 language: python python: - '2.7' +services: +- postgresql install: - pip install -e .[testing] before_script: - bin/install_client_deps.sh +- psql -c "CREATE USER memopol WITH CREATEDB PASSWORD 'memopol';" -U postgres +- psql -c "CREATE DATABASE memopol WITH OWNER memopol;" -U postgres script: - flake8 . --exclude '*/migrations,docs,static' --ignore E128 - py.test memopol representatives_positions representatives_recommendations diff --git a/bin/quickstart.sh b/bin/quickstart.sh index 4d92a5086ebfa6112fc337ed6b307bbf812f94b6..182ac481bcee7936cf4d0c0de735211ed50f2d8f 100755 --- a/bin/quickstart.sh +++ b/bin/quickstart.sh @@ -22,6 +22,15 @@ pip install -e .[testing] # Install client dependencies bin/install_client_deps.sh +# Create pg user and database +if [ $(psql -c "select 'CNT=' || count(1) from pg_catalog.pg_user where usename='memopol';" -U postgres | grep CNT=1 | wc -l) -lt 1 ]; then + psql -c "create user memopol with password 'memopol';" -U postgres +fi +psql -c "alter role memopol with createdb;" -U postgres +if [ $(psql -l -U postgres | egrep "^ memopol\W" | wc -l) -lt 1 ]; then + psql -c "create database memopol with owner memopol;" -U postgres +fi + # Setup environment export DJANGO_DEBUG=True export DJANGO_SETTINGS_MODULE=memopol.settings diff --git a/docs/development.rst b/docs/development.rst index cad40a4f9ee6877db449354b8f5e97755b41110f..8f7e7c86efd22b7c70d3784ae908191f8562649c 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -101,38 +101,33 @@ the ``DJANGO_DEBUG`` variable in the current shell:: $ export DJANGO_DEBUG=True -Run the development server -========================== +Setup the database +================== -Run the development server:: +Memopol requires PostgreSQL 9.1 or higher. It used to run with SQLite, too, but +that is no longer the case. Memopol uses the following environment variables +for database access: - $ ./manage.py runserver +* ``MEMOPOL_DB_NAME`` (defaults to 'memopol') +* ``MEMOPOL_DB_USER`` (defaults to 'memopol') +* ``MEMOPOL_DB_PASSWORD`` (defaults to 'memopol') +* ``MEMOPOL_DB_HOST`` (defaults to 'localhost') +* ``MEMOPOL_DB_PORT`` (defaults to '5432') - Performing system checks... +Make sure the corresponding user and database exist on your system; the user +will need the 'createdb' permission in order to be able to run tests. To create +them, you may use the following commands: - System check identified no issues (0 silenced). - December 09, 2015 - 21:26:47 - Django version 1.8.7, using settings 'memopol.settings' - Starting development server at http://127.0.0.1:8000/ - Quit the server with CONTROL-C. - [09/Dec/2015 21:26:48] "GET / HTTP/1.1" 200 13294 - -The website is running on ``http://127.0.0.1:8000/``. + $ psql -c "create user memopol with password 'memopol';" -U postgres + $ psql -c "alter role memopol with createdb;" -U postgres + $ psql -c "create database memopol with owner memopol;" -U postgres Database migrations =================== -The repo comes with a pre-configured SQLite db with sample data so that you can -start hacking right away. However, if you were to use a local postgresql -database ie. with this sort of environment:: - - export DJANGO_DATABASE_DEFAULT_NAME=memopol - export DJANGO_DATABASE_DEFAULT_USER=postgres - export DJANGO_DATABASE_DEFAULT_ENGINE=django.db.backends.postgresql_psycopg2 - export DJANGO_DEBUG=1 - export DJANGO_SETTINGS_MODULE=memopol.settings - -Then you could run database migrations:: +Database migrations ensure the database schema is up to date with the project. +If you're not sure, you can run them anyway, they won't do any harm. Use the +following command:: $ ./manage.py migrate Operations to perform: @@ -153,8 +148,7 @@ Then you could run database migrations:: Provision with data =================== -Again, the repo comes with a pre-configured SQLite db with sample data so that -you can start hacking right away. However, you could still reload sample data:: +You can load a small data sample for quick setup: $ ./manage.py loaddata memopol/fixtures/small_sample.json @@ -162,4 +156,22 @@ Or actual data (takes a while):: $ bin/update_all +Run the development server +========================== + +Run the development server:: + + $ ./manage.py runserver + + Performing system checks... + + System check identified no issues (0 silenced). + December 09, 2015 - 21:26:47 + Django version 1.8.7, using settings 'memopol.settings' + Starting development server at http://127.0.0.1:8000/ + Quit the server with CONTROL-C. + [09/Dec/2015 21:26:48] "GET / HTTP/1.1" 200 13294 + +The website is running on ``http://127.0.0.1:8000/``. + Continue to :doc:`administration`. diff --git a/memopol/settings.py b/memopol/settings.py index 602111479851769738291990cd61a681c0b6271c..227bba18f40cfb3002ac3e7df43d503e0046db5a 100644 --- a/memopol/settings.py +++ b/memopol/settings.py @@ -125,20 +125,16 @@ WSGI_APPLICATION = 'memopol.wsgi.application' DATABASES = { 'default': { - 'NAME': os.environ.get('DJANGO_DATABASE_DEFAULT_NAME', 'db.sqlite'), - 'USER': os.environ.get('DJANGO_DATABASE_DEFAULT_USER', ''), - 'PASSWORD': os.environ.get('DJANGO_DATABASE_DEFAULT_PASSWORD', ''), - 'HOST': os.environ.get('DJANGO_DATABASE_DEFAULT_HOST', ''), - 'PORT': os.environ.get('DJANGO_DATABASE_DEFAULT_PORT', ''), - 'ENGINE': os.environ.get('DJANGO_DATABASE_DEFAULT_ENGINE', - 'django.db.backends.sqlite3'), - + 'NAME': os.environ.get('MEMOPOL_DB_NAME', 'memopol'), + 'USER': os.environ.get('MEMOPOL_DB_USER', 'memopol'), + 'PASSWORD': os.environ.get('MEMOPOL_DB_PASSWORD', 'memopol'), + 'HOST': os.environ.get('MEMOPOL_DB_HOST', 'localhost'), + 'PORT': os.environ.get('MEMOPOL_DB_PORT', '5432'), + 'ENGINE': os.environ.get('MEMOPOL_DB_ENGINE', + 'django.db.backends.postgresql_psycopg2'), } } -if 'OPENSHIFT_DATA_DIR' in os.environ: - DATABASES['default']['NAME'] = os.path.join(DATA_DIR, 'db.sqlite') - if 'OPENSHIFT_POSTGRESQL_DB_HOST' in os.environ: DATABASES['default']['NAME'] = os.environ['OPENSHIFT_APP_NAME'] DATABASES['default']['USER'] = os.environ[ @@ -147,7 +143,6 @@ if 'OPENSHIFT_POSTGRESQL_DB_HOST' in os.environ: 'OPENSHIFT_POSTGRESQL_DB_PASSWORD'] DATABASES['default']['HOST'] = os.environ['OPENSHIFT_POSTGRESQL_DB_HOST'] DATABASES['default']['PORT'] = os.environ['OPENSHIFT_POSTGRESQL_DB_PORT'] - DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2' # Internationalization # https://docs.djangoproject.com/en/1.7/topics/i18n/ diff --git a/memopol/tests/RepresentativeDetailTest/test_mandates_display.html b/memopol/tests/RepresentativeDetailTest/test_mandates_display.html index d464619bc47be825ce28472126aa745dd0f55a98..1fae20a14ed88aaaef94a1051181c88e6aa37cf7 100644 --- a/memopol/tests/RepresentativeDetailTest/test_mandates_display.html +++ b/memopol/tests/RepresentativeDetailTest/test_mandates_display.html @@ -3,17 +3,23 @@ <table class='table table-condensed mandates'> <tr class='mandate'> - <td>Member</td> + <td>Substitute</td> <td> - <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Women's%20Rights%20and%20Gender%20Equality/'> - Committee on Women's Rights and Gender Equality - - FEMM + <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20for%20relations%20with%20Palestine/'> + Delegation for relations with Palestine </a> </td> - <td>01/07/2014</td> - <td>present</td> + <td> + + 14/07/2014 + + </td> + <td> + + present + + </td> <td>European Parliament</td> </tr> @@ -21,15 +27,43 @@ <tr class='mandate'> <td>Member</td> <td> - <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Legal%20Affairs/'> - Committee on Legal Affairs + <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20for%20relations%20with%20South%20Africa/'> + Delegation for relations with South Africa - JURI + </a> + </td> + <td> + + 14/07/2014 + + </td> + <td> + + present + + </td> + <td>European Parliament</td> + + </tr> + + <tr class='mandate'> + <td>Member</td> + <td> + <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20Parliamentary%20Assembly%20of%20the%20Union%20for%20the%20Mediterranean/'> + Delegation to the Parliamentary Assembly of the Union for the Mediterranean </a> </td> - <td>01/07/2014</td> - <td>present</td> + <td> + + 14/07/2014 + + </td> + <td> + + present + + </td> <td>European Parliament</td> </tr> @@ -44,22 +78,16 @@ </a> </td> - <td>08/07/2014</td> - <td>present</td> - <td>European Parliament</td> + <td> - </tr> + 08/07/2014 - <tr class='mandate'> - <td>Member</td> + </td> <td> - <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20for%20relations%20with%20South%20Africa/'> - Delegation for relations with South Africa - </a> + present + </td> - <td>14/07/2014</td> - <td>present</td> <td>European Parliament</td> </tr> @@ -67,27 +95,23 @@ <tr class='mandate'> <td>Member</td> <td> - <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20Parliamentary%20Assembly%20of%20the%20Union%20for%20the%20Mediterranean/'> - Delegation to the Parliamentary Assembly of the Union for the Mediterranean + <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Legal%20Affairs/'> + Committee on Legal Affairs + + JURI </a> </td> - <td>14/07/2014</td> - <td>present</td> - <td>European Parliament</td> + <td> - </tr> + 01/07/2014 - <tr class='mandate'> - <td>Substitute</td> + </td> <td> - <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20for%20relations%20with%20Palestine/'> - Delegation for relations with Palestine - </a> + present + </td> - <td>14/07/2014</td> - <td>present</td> <td>European Parliament</td> </tr> @@ -95,15 +119,23 @@ <tr class='mandate'> <td>Member</td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - Group of the Progressive Alliance of Socialists and Democrats in the European Parliament + <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Women's%20Rights%20and%20Gender%20Equality/'> + Committee on Women's Rights and Gender Equality - SD + FEMM </a> </td> - <td>01/07/2014</td> - <td>present</td> + <td> + + 01/07/2014 + + </td> + <td> + + present + + </td> <td>European Parliament</td> </tr> @@ -118,8 +150,16 @@ </a> </td> - <td>01/07/2014</td> - <td>present</td> + <td> + + 01/07/2014 + + </td> + <td> + + present + + </td> <td>Labour Party</td> </tr> @@ -127,15 +167,23 @@ <tr class='mandate'> <td>Member</td> <td> - <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Women's%20Rights%20and%20Gender%20Equality/'> - Committee on Women's Rights and Gender Equality + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + Group of the Progressive Alliance of Socialists and Democrats in the European Parliament - FEMM + SD </a> </td> - <td>19/01/2012</td> - <td>30/06/2014</td> + <td> + + 01/07/2014 + + </td> + <td> + + present + + </td> <td>European Parliament</td> </tr> @@ -150,8 +198,16 @@ </a> </td> - <td>19/01/2012</td> - <td>30/06/2014</td> + <td> + + 19/01/2012 + + </td> + <td> + + 30/06/2014 + + </td> <td>European Parliament</td> </tr> @@ -166,8 +222,40 @@ </a> </td> - <td>19/01/2012</td> - <td>30/06/2014</td> + <td> + + 19/01/2012 + + </td> + <td> + + 30/06/2014 + + </td> + <td>European Parliament</td> + + </tr> + + <tr class='mandate'> + <td>Member</td> + <td> + <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Women's%20Rights%20and%20Gender%20Equality/'> + Committee on Women's Rights and Gender Equality + + FEMM + + </a> + </td> + <td> + + 19/01/2012 + + </td> + <td> + + 30/06/2014 + + </td> <td>European Parliament</td> </tr> @@ -180,24 +268,16 @@ </a> </td> - <td>16/09/2009</td> - <td>30/06/2014</td> - <td>European Parliament</td> + <td> - </tr> + 16/09/2009 - <tr class='mandate'> - <td>Member</td> + </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - Group of the Progressive Alliance of Socialists and Democrats in the European Parliament - SD + 30/06/2014 - </a> </td> - <td>14/07/2009</td> - <td>30/06/2014</td> <td>European Parliament</td> </tr> @@ -212,8 +292,16 @@ </a> </td> - <td>14/07/2009</td> - <td>30/06/2014</td> + <td> + + 14/07/2009 + + </td> + <td> + + 30/06/2014 + + </td> <td>Labour Party</td> </tr> @@ -221,15 +309,47 @@ <tr class='mandate'> <td>Member</td> <td> - <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Women's%20Rights%20and%20Gender%20Equality/'> - Committee on Women's Rights and Gender Equality + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + Group of the Progressive Alliance of Socialists and Democrats in the European Parliament - FEMM + SD </a> </td> - <td>16/07/2009</td> - <td>18/01/2012</td> + <td> + + 14/07/2009 + + </td> + <td> + + 30/06/2014 + + </td> + <td>European Parliament</td> + + </tr> + + <tr class='mandate'> + <td>Substitute</td> + <td> + <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Legal%20Affairs/'> + Committee on Legal Affairs + + JURI + + </a> + </td> + <td> + + 20/09/2010 + + </td> + <td> + + 18/01/2012 + + </td> <td>European Parliament</td> </tr> @@ -244,24 +364,40 @@ </a> </td> - <td>16/07/2009</td> - <td>18/01/2012</td> + <td> + + 16/07/2009 + + </td> + <td> + + 18/01/2012 + + </td> <td>European Parliament</td> </tr> <tr class='mandate'> - <td>Substitute</td> + <td>Member</td> <td> - <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Legal%20Affairs/'> - Committee on Legal Affairs + <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Women's%20Rights%20and%20Gender%20Equality/'> + Committee on Women's Rights and Gender Equality - JURI + FEMM </a> </td> - <td>20/09/2010</td> - <td>18/01/2012</td> + <td> + + 16/07/2009 + + </td> + <td> + + 18/01/2012 + + </td> <td>European Parliament</td> </tr> @@ -276,24 +412,16 @@ </a> </td> - <td>16/07/2009</td> - <td>19/09/2010</td> - <td>European Parliament</td> + <td> - </tr> + 16/07/2009 - <tr class='mandate'> - <td>Member</td> + </td> <td> - <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Industry,%20Research%20and%20Energy/'> - Committee on Industry, Research and Energy - ITRE + 19/09/2010 - </a> </td> - <td>31/01/2007</td> - <td>13/07/2009</td> <td>European Parliament</td> </tr> @@ -308,8 +436,40 @@ </a> </td> - <td>31/01/2007</td> - <td>13/07/2009</td> + <td> + + 31/01/2007 + + </td> + <td> + + 13/07/2009 + + </td> + <td>European Parliament</td> + + </tr> + + <tr class='mandate'> + <td>Member</td> + <td> + <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Industry,%20Research%20and%20Energy/'> + Committee on Industry, Research and Energy + + ITRE + + </a> + </td> + <td> + + 31/01/2007 + + </td> + <td> + + 13/07/2009 + + </td> <td>European Parliament</td> </tr> @@ -324,8 +484,16 @@ </a> </td> - <td>31/01/2007</td> - <td>13/07/2009</td> + <td> + + 31/01/2007 + + </td> + <td> + + 13/07/2009 + + </td> <td>European Parliament</td> </tr> @@ -338,8 +506,16 @@ </a> </td> - <td>15/09/2004</td> - <td>13/07/2009</td> + <td> + + 15/09/2004 + + </td> + <td> + + 13/07/2009 + + </td> <td>European Parliament</td> </tr> @@ -347,13 +523,21 @@ <tr class='mandate'> <td>Substitute</td> <td> - <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20EU-Turkey%20Joint%20Parliamentary%20Committee/'> - Delegation to the EU-Turkey Joint Parliamentary Committee + <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20Euro-Mediterranean%20Parliamentary%20Assembly/'> + Delegation to the Euro-Mediterranean Parliamentary Assembly </a> </td> - <td>15/09/2004</td> - <td>13/07/2009</td> + <td> + + 15/09/2004 + + </td> + <td> + + 13/07/2009 + + </td> <td>European Parliament</td> </tr> @@ -361,17 +545,49 @@ <tr class='mandate'> <td>Substitute</td> <td> - <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20Euro-Mediterranean%20Parliamentary%20Assembly/'> - Delegation to the Euro-Mediterranean Parliamentary Assembly + <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20EU-Turkey%20Joint%20Parliamentary%20Committee/'> + Delegation to the EU-Turkey Joint Parliamentary Committee </a> </td> - <td>15/09/2004</td> - <td>13/07/2009</td> + <td> + + 15/09/2004 + + </td> + <td> + + 13/07/2009 + + </td> <td>European Parliament</td> </tr> + <tr class='mandate'> + <td></td> + <td> + <a href='/legislature/representative/country/United%20Kingdom/'> + United Kingdom + + GB + + </a> + </td> + <td> + + 20/07/2004 + + </td> + <td> + + 13/07/2009 + + </td> + <td>Labour Party</td> + + </tr> + <tr class='mandate'> <td>Member</td> <td> @@ -382,25 +598,41 @@ </a> </td> - <td>20/07/2004</td> - <td>13/07/2009</td> + <td> + + 20/07/2004 + + </td> + <td> + + 13/07/2009 + + </td> <td>European Parliament</td> </tr> <tr class='mandate'> - <td></td> + <td>Substitute</td> <td> - <a href='/legislature/representative/country/United%20Kingdom/'> - United Kingdom + <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Culture%20and%20Education/'> + Committee on Culture and Education - GB + CULT </a> </td> - <td>20/07/2004</td> - <td>13/07/2009</td> - <td>Labour Party</td> + <td> + + 15/01/2007 + + </td> + <td> + + 30/01/2007 + + </td> + <td>European Parliament</td> </tr> @@ -414,8 +646,16 @@ </a> </td> - <td>15/01/2007</td> - <td>30/01/2007</td> + <td> + + 15/01/2007 + + </td> + <td> + + 30/01/2007 + + </td> <td>European Parliament</td> </tr> @@ -430,8 +670,16 @@ </a> </td> - <td>15/01/2007</td> - <td>30/01/2007</td> + <td> + + 15/01/2007 + + </td> + <td> + + 30/01/2007 + + </td> <td>European Parliament</td> </tr> @@ -446,8 +694,16 @@ </a> </td> - <td>15/01/2007</td> - <td>30/01/2007</td> + <td> + + 21/07/2004 + + </td> + <td> + + 14/01/2007 + + </td> <td>European Parliament</td> </tr> @@ -462,8 +718,16 @@ </a> </td> - <td>21/07/2004</td> - <td>14/01/2007</td> + <td> + + 21/07/2004 + + </td> + <td> + + 14/01/2007 + + </td> <td>European Parliament</td> </tr> @@ -478,24 +742,16 @@ </a> </td> - <td>21/07/2004</td> - <td>14/01/2007</td> - <td>European Parliament</td> + <td> - </tr> + 21/07/2004 - <tr class='mandate'> - <td>Substitute</td> + </td> <td> - <a href='/legislature/representative/committee/European%20Parliament/Committee%20on%20Culture%20and%20Education/'> - Committee on Culture and Education - CULT + 14/01/2007 - </a> </td> - <td>21/07/2004</td> - <td>14/01/2007</td> <td>European Parliament</td> </tr> @@ -510,24 +766,16 @@ </a> </td> - <td>17/01/2002</td> - <td>19/07/2004</td> - <td>European Parliament</td> + <td> - </tr> + 17/01/2002 - <tr class='mandate'> - <td>Member</td> + </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Party%20of%20European%20Socialists/'> - Group of the Party of European Socialists - PSE + 19/07/2004 - </a> </td> - <td>17/02/2000</td> - <td>19/07/2004</td> <td>European Parliament</td> </tr> @@ -542,12 +790,44 @@ </a> </td> - <td>17/02/2000</td> - <td>19/07/2004</td> + <td> + + 17/02/2000 + + </td> + <td> + + 19/07/2004 + + </td> <td>Labour Party</td> </tr> + <tr class='mandate'> + <td>Member</td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Party%20of%20European%20Socialists/'> + Group of the Party of European Socialists + + PSE + + </a> + </td> + <td> + + 17/02/2000 + + </td> + <td> + + 19/07/2004 + + </td> + <td>European Parliament</td> + + </tr> + <tr class='mandate'> <td>Member</td> <td> @@ -556,8 +836,16 @@ </a> </td> - <td>07/02/2002</td> - <td>30/04/2004</td> + <td> + + 07/02/2002 + + </td> + <td> + + 30/04/2004 + + </td> <td>European Parliament</td> </tr> @@ -570,8 +858,38 @@ </a> </td> - <td>07/02/2002</td> - <td>30/04/2004</td> + <td> + + 07/02/2002 + + </td> + <td> + + 30/04/2004 + + </td> + <td>European Parliament</td> + + </tr> + + <tr class='mandate'> + <td>Member</td> + <td> + <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20EU-Cyprus%20Joint%20Parliamentary%20Committee/'> + Delegation to the EU-Cyprus Joint Parliamentary Committee + + </a> + </td> + <td> + + 11/04/2000 + + </td> + <td> + + 14/01/2002 + + </td> <td>European Parliament</td> </tr> @@ -586,25 +904,18 @@ </a> </td> - <td>01/03/2000</td> - <td>14/01/2002</td> - <td>European Parliament</td> + <td> - </tr> + 01/03/2000 - <tr class='mandate'> - <td>Member</td> + </td> <td> - <a href='/legislature/representative/delegation/European%20Parliament/Delegation%20to%20the%20EU-Cyprus%20Joint%20Parliamentary%20Committee/'> - Delegation to the EU-Cyprus Joint Parliamentary Committee - </a> + 14/01/2002 + </td> - <td>11/04/2000</td> - <td>14/01/2002</td> <td>European Parliament</td> </tr> </table> - diff --git a/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content b/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content index 5411c42a78fad7e28769e8597298b65b1c565d2f..1dae14d964bf8b2b8fe98e0ec259ebfa26cbea35 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_active_parties.content @@ -238,41 +238,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> - - EFDD - - </a> - </td> - <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> - - <span class="group-icon group-icon-efdd"></span> Europe of Freedom and Direct Democracy Group - - </a> - </td> - </tr> - - <tr> - - <td> - <a href='/legislature/representative/chamber/European%20Parliament/'> - <span class="chamber-icon chamber-icon-ep"></span> European Parliament - - </a> - </td> - - <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> - ENF + ECR </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> - <span class="group-icon group-icon-enf"></span> Europe of Nations and Freedom Group + <span class="group-icon group-icon-ecr"></span> European Conservatives and Reformists Group </a> </td> @@ -313,16 +288,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> - ECR + EFDD </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> - <span class="group-icon group-icon-ecr"></span> European Conservatives and Reformists Group + <span class="group-icon group-icon-efdd"></span> Europe of Freedom and Direct Democracy Group </a> </td> @@ -338,16 +313,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20Union%20for%20Europe/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> - UFE + ENF </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20Union%20for%20Europe/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> - <span class="group-icon group-icon-ufe"></span> Group Union for Europe + <span class="group-icon group-icon-enf"></span> Europe of Nations and Freedom Group </a> </td> @@ -478,6 +453,31 @@ </td> </tr> + <tr> + + <td> + <a href='/legislature/representative/chamber/European%20Parliament/'> + <span class="chamber-icon chamber-icon-ep"></span> European Parliament + + </a> + </td> + + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Radical%20Alliance/'> + + ERA + + </a> + </td> + <td> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Radical%20Alliance/'> + + <span class="group-icon group-icon-era"></span> Group of the European Radical Alliance + + </a> + </td> + </tr> + </table> diff --git a/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content b/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content index b2b606aa01625ec0a1f77b4123f5c61802007e10..da03bae7637c0645b2d15dbb7306c26ad5273993 100644 --- a/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content +++ b/memopol/tests/response_fixtures/GroupListTest.test_all_parties.content @@ -274,16 +274,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> - EFDD + ECR </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> - <span class="group-icon group-icon-efdd"></span> Europe of Freedom and Direct Democracy Group + <span class="group-icon group-icon-ecr"></span> European Conservatives and Reformists Group </a> </td> @@ -299,16 +299,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20freedom%20and%20democracy%20Group/'> - ENF + EFD </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20freedom%20and%20democracy%20Group/'> - <span class="group-icon group-icon-enf"></span> Europe of Nations and Freedom Group + <span class="group-icon group-icon-efd"></span> Europe of freedom and democracy Group </a> </td> @@ -324,16 +324,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20freedom%20and%20democracy%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> - EFD + EFDD </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20freedom%20and%20democracy%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Freedom%20and%20Direct%20Democracy%20Group/'> - <span class="group-icon group-icon-efd"></span> Europe of freedom and democracy Group + <span class="group-icon group-icon-efdd"></span> Europe of Freedom and Direct Democracy Group </a> </td> @@ -349,16 +349,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> - ECR + ENF </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/European%20Conservatives%20and%20Reformists%20Group/'> + <a href='/legislature/representative/group/European%20Parliament/Europe%20of%20Nations%20and%20Freedom%20Group/'> - <span class="group-icon group-icon-ecr"></span> European Conservatives and Reformists Group + <span class="group-icon group-icon-enf"></span> Europe of Nations and Freedom Group </a> </td> @@ -374,16 +374,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20Union%20for%20Europe/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20for%20a%20Europe%20of%20Democracies%20and%20Diversities/'> - UFE + EDD </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20Union%20for%20Europe/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20for%20a%20Europe%20of%20Democracies%20and%20Diversities/'> - <span class="group-icon group-icon-ufe"></span> Group Union for Europe + <span class="group-icon group-icon-edd"></span> Group for a Europe of Democracies and Diversities </a> </td> @@ -399,16 +399,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20for%20a%20Europe%20of%20Democracies%20and%20Diversities/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20Independents%20for%20a%20Europe%20of%20Nations/'> - EDD + ER </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20for%20a%20Europe%20of%20Democracies%20and%20Diversities/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20Independents%20for%20a%20Europe%20of%20Nations/'> - <span class="group-icon group-icon-edd"></span> Group for a Europe of Democracies and Diversities + <span class="group-icon group-icon-er"></span> Group of Independents for a Europe of Nations </a> </td> @@ -424,16 +424,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20Independents%20for%20a%20Europe%20of%20Nations/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - ER + ALDE </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20Independents%20for%20a%20Europe%20of%20Nations/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> - <span class="group-icon group-icon-er"></span> Group of Independents for a Europe of Nations + <span class="group-icon group-icon-alde"></span> Group of the Alliance of Liberals and Democrats for Europe </a> </td> @@ -449,16 +449,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Democratic%20Alliance/'> - ALDE + EDA </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Alliance%20of%20Liberals%20and%20Democrats%20for%20Europe/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Democratic%20Alliance/'> - <span class="group-icon group-icon-alde"></span> Group of the Alliance of Liberals and Democrats for Europe + <span class="group-icon group-icon-eda"></span> Group of the European Democratic Alliance </a> </td> @@ -474,16 +474,16 @@ </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Democratic%20Alliance/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Liberal,%20Democrat%20and%20Reform%20Party/'> - EDA + ELDR </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Democratic%20Alliance/'> + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20Liberal,%20Democrat%20and%20Reform%20Party/'> - <span class="group-icon group-icon-eda"></span> Group of the European Democratic Alliance + <span class="group-icon group-icon-eldr"></span> Group of the European Liberal, Democrat and Reform Party </a> </td> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content index 48d792e8633824b2ac5852847565d003f16c8508..d14620b62367b03b1ccc9d4333cbeda65d696743 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_filter_chamber.content @@ -553,14 +553,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/michel-dantin/'> - <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + <a href='/legislature/representative/viorica-dancila/'> + <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/michel-dantin/'> - Michel DANTIN + <a href='/legislature/representative/viorica-dancila/'> + Viorica DÄ‚NCILÄ‚ </a> </li> <li class='chamber'> @@ -569,17 +569,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/France/'> - <span class="flag-icon flag-icon-fr"></span> France + <a href='/legislature/representative/country/Romania/'> + <span class="flag-icon flag-icon-ro"></span> Romania </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </li> <li class='score'> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </li> </ul> @@ -587,14 +587,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/tamas-deutsch/'> - <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/tamas-deutsch/'> - Tamás DEUTSCH + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN </a> </li> <li class='chamber'> @@ -603,8 +603,8 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Hungary/'> - <span class="flag-icon flag-icon-hu"></span> Hungary + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France </a> </li> <li class='mandate'> @@ -621,14 +621,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/viorica-dancila/'> - <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/viorica-dancila/'> - Viorica DÄ‚NCILÄ‚ + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH </a> </li> <li class='chamber'> @@ -637,17 +637,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Romania/'> - <span class="flag-icon flag-icon-ro"></span> Romania + <a href='/legislature/representative/country/Hungary/'> + <span class="flag-icon flag-icon-hu"></span> Hungary </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </li> <li class='score'> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </li> </ul> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content index 0250a0930ea8fda297a6b98a24e21f2c5315b990..0dd2bb83ff3f4c2a01f8f5c2769305ccef9a4222 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_active_displaylist.content @@ -590,14 +590,14 @@ <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/michel-dantin/'> - <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + <a href='/legislature/representative/viorica-dancila/'> + <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/michel-dantin/'> - Michel DANTIN + <a href='/legislature/representative/viorica-dancila/'> + Viorica DÄ‚NCILÄ‚ </a> </td> @@ -608,32 +608,32 @@ </a> </td> <td> - <a href='/legislature/representative/country/France/'> - France [FR] + <a href='/legislature/representative/country/Romania/'> + Romania [RO] </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </td> <td> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </td> </tr> <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/tamas-deutsch/'> - <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/tamas-deutsch/'> - Tamás DEUTSCH + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN </a> </td> @@ -644,8 +644,8 @@ </a> </td> <td> - <a href='/legislature/representative/country/Hungary/'> - Hungary [HU] + <a href='/legislature/representative/country/France/'> + France [FR] </a> </td> @@ -662,14 +662,14 @@ <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/viorica-dancila/'> - <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/viorica-dancila/'> - Viorica DÄ‚NCILÄ‚ + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH </a> </td> @@ -680,18 +680,18 @@ </a> </td> <td> - <a href='/legislature/representative/country/Romania/'> - Romania [RO] + <a href='/legislature/representative/country/Hungary/'> + Hungary [HU] </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </td> <td> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </td> </tr> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content index 84db20acd8b778afe9e1a28c5d5e2e61d77aa8d7..ffc0e5d15999a2785c8587aa575f3e6d8030ddbe 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby12_all_displaylist.content @@ -590,14 +590,14 @@ <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/michel-dantin/'> - <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + <a href='/legislature/representative/viorica-dancila/'> + <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/michel-dantin/'> - Michel DANTIN + <a href='/legislature/representative/viorica-dancila/'> + Viorica DÄ‚NCILÄ‚ </a> </td> @@ -608,32 +608,32 @@ </a> </td> <td> - <a href='/legislature/representative/country/France/'> - France [FR] + <a href='/legislature/representative/country/Romania/'> + Romania [RO] </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </td> <td> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </td> </tr> <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/tamas-deutsch/'> - <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/tamas-deutsch/'> - Tamás DEUTSCH + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN </a> </td> @@ -644,8 +644,8 @@ </a> </td> <td> - <a href='/legislature/representative/country/Hungary/'> - Hungary [HU] + <a href='/legislature/representative/country/France/'> + France [FR] </a> </td> @@ -662,14 +662,14 @@ <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/viorica-dancila/'> - <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/viorica-dancila/'> - Viorica DÄ‚NCILÄ‚ + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH </a> </td> @@ -680,18 +680,18 @@ </a> </td> <td> - <a href='/legislature/representative/country/Romania/'> - Romania [RO] + <a href='/legislature/representative/country/Hungary/'> + Hungary [HU] </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </td> <td> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </td> </tr> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content index 3cb5bef41b080c32865fd89740f99bddde87ac2c..8b02937834b55278e107acb4b95546e3e78e13b6 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_active_displaygrid.content @@ -542,14 +542,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/michel-dantin/'> - <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + <a href='/legislature/representative/viorica-dancila/'> + <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/michel-dantin/'> - Michel DANTIN + <a href='/legislature/representative/viorica-dancila/'> + Viorica DÄ‚NCILÄ‚ </a> </li> <li class='chamber'> @@ -558,17 +558,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/France/'> - <span class="flag-icon flag-icon-fr"></span> France + <a href='/legislature/representative/country/Romania/'> + <span class="flag-icon flag-icon-ro"></span> Romania </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </li> <li class='score'> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </li> </ul> @@ -576,14 +576,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/tamas-deutsch/'> - <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/tamas-deutsch/'> - Tamás DEUTSCH + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN </a> </li> <li class='chamber'> @@ -592,8 +592,8 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Hungary/'> - <span class="flag-icon flag-icon-hu"></span> Hungary + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France </a> </li> <li class='mandate'> @@ -610,14 +610,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/viorica-dancila/'> - <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/viorica-dancila/'> - Viorica DÄ‚NCILÄ‚ + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH </a> </li> <li class='chamber'> @@ -626,17 +626,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Romania/'> - <span class="flag-icon flag-icon-ro"></span> Romania + <a href='/legislature/representative/country/Hungary/'> + <span class="flag-icon flag-icon-hu"></span> Hungary </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </li> <li class='score'> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </li> </ul> @@ -814,14 +814,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> + <a href='/legislature/representative/kinga-gal/'> + <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - Eider GARDIAZABAL RUBIAL + <a href='/legislature/representative/kinga-gal/'> + Kinga GÃL </a> </li> <li class='chamber'> @@ -830,17 +830,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Spain/'> - <span class="flag-icon flag-icon-es"></span> Spain + <a href='/legislature/representative/country/Hungary/'> + <span class="flag-icon flag-icon-hu"></span> Hungary </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </li> <li class='score'> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </li> </ul> @@ -848,14 +848,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/kinga-gal/'> - <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> + <a href='/legislature/representative/ildiko-gall-pelcz/'> + <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/kinga-gal/'> - Kinga GÃL + <a href='/legislature/representative/ildiko-gall-pelcz/'> + Ildikó GÃLL-PELCZ </a> </li> <li class='chamber'> @@ -882,14 +882,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - Ildikó GÃLL-PELCZ + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + Eider GARDIAZABAL RUBIAL </a> </li> <li class='chamber'> @@ -898,17 +898,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Hungary/'> - <span class="flag-icon flag-icon-hu"></span> Hungary + <a href='/legislature/representative/country/Spain/'> + <span class="flag-icon flag-icon-es"></span> Spain </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </li> <li class='score'> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </li> </ul> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content index a2c53d554e530995494f96a0fdd455cd651a684c..552426394d4ca7dd0d335dd6400d78244ed9e6da 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page1_paginateby24_all_displaygrid.content @@ -542,14 +542,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/michel-dantin/'> - <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> + <a href='/legislature/representative/viorica-dancila/'> + <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/michel-dantin/'> - Michel DANTIN + <a href='/legislature/representative/viorica-dancila/'> + Viorica DÄ‚NCILÄ‚ </a> </li> <li class='chamber'> @@ -558,17 +558,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/France/'> - <span class="flag-icon flag-icon-fr"></span> France + <a href='/legislature/representative/country/Romania/'> + <span class="flag-icon flag-icon-ro"></span> Romania </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </li> <li class='score'> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </li> </ul> @@ -576,14 +576,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/tamas-deutsch/'> - <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> + <a href='/legislature/representative/michel-dantin/'> + <img src='http://www.europarl.europa.eu/mepphoto/97296.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/tamas-deutsch/'> - Tamás DEUTSCH + <a href='/legislature/representative/michel-dantin/'> + Michel DANTIN </a> </li> <li class='chamber'> @@ -592,8 +592,8 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Hungary/'> - <span class="flag-icon flag-icon-hu"></span> Hungary + <a href='/legislature/representative/country/France/'> + <span class="flag-icon flag-icon-fr"></span> France </a> </li> <li class='mandate'> @@ -610,14 +610,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/viorica-dancila/'> - <img src='http://www.europarl.europa.eu/mepphoto/95281.jpg' width='80' /> + <a href='/legislature/representative/tamas-deutsch/'> + <img src='http://www.europarl.europa.eu/mepphoto/96826.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/viorica-dancila/'> - Viorica DÄ‚NCILÄ‚ + <a href='/legislature/representative/tamas-deutsch/'> + Tamás DEUTSCH </a> </li> <li class='chamber'> @@ -626,17 +626,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Romania/'> - <span class="flag-icon flag-icon-ro"></span> Romania + <a href='/legislature/representative/country/Hungary/'> + <span class="flag-icon flag-icon-hu"></span> Hungary </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </li> <li class='score'> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </li> </ul> @@ -814,14 +814,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> + <a href='/legislature/representative/kinga-gal/'> + <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - Eider GARDIAZABAL RUBIAL + <a href='/legislature/representative/kinga-gal/'> + Kinga GÃL </a> </li> <li class='chamber'> @@ -830,17 +830,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Spain/'> - <span class="flag-icon flag-icon-es"></span> Spain + <a href='/legislature/representative/country/Hungary/'> + <span class="flag-icon flag-icon-hu"></span> Hungary </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </li> <li class='score'> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </li> </ul> @@ -848,14 +848,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/kinga-gal/'> - <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> + <a href='/legislature/representative/ildiko-gall-pelcz/'> + <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/kinga-gal/'> - Kinga GÃL + <a href='/legislature/representative/ildiko-gall-pelcz/'> + Ildikó GÃLL-PELCZ </a> </li> <li class='chamber'> @@ -882,14 +882,14 @@ <div class='representative_item active'> <p class='photo'> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> </a> </p> <ul> <li class='name'> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - Ildikó GÃLL-PELCZ + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + Eider GARDIAZABAL RUBIAL </a> </li> <li class='chamber'> @@ -898,17 +898,17 @@ </a> </li> <li class='country'> - <a href='/legislature/representative/country/Hungary/'> - <span class="flag-icon flag-icon-hu"></span> Hungary + <a href='/legislature/representative/country/Spain/'> + <span class="flag-icon flag-icon-es"></span> Spain </a> </li> <li class='mandate'> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </li> <li class='score'> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </li> </ul> diff --git a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content index 294423ff161be09fc9d063aeeeb3ab93a330c695..cb897b6b600d34e4d8660783baf68043a881c1ab 100644 --- a/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content +++ b/memopol/tests/response_fixtures/RepresentativeListTest.test_page2_paginateby12_displaylist.content @@ -459,14 +459,14 @@ <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> + <a href='/legislature/representative/kinga-gal/'> + <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/eider-gardiazabal-rubial/'> - Eider GARDIAZABAL RUBIAL + <a href='/legislature/representative/kinga-gal/'> + Kinga GÃL </a> </td> @@ -477,32 +477,32 @@ </a> </td> <td> - <a href='/legislature/representative/country/Spain/'> - Spain [ES] + <a href='/legislature/representative/country/Hungary/'> + Hungary [HU] </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> - <span class="group-icon group-icon-sd"></span> SD + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> + <span class="group-icon group-icon-epp"></span> EPP </a> </td> <td> - <span class="label label-success">15</span> + <span class="label label-danger">-15</span> </td> </tr> <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/kinga-gal/'> - <img src='http://www.europarl.europa.eu/mepphoto/28150.jpg' width='80' /> + <a href='/legislature/representative/ildiko-gall-pelcz/'> + <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/kinga-gal/'> - Kinga GÃL + <a href='/legislature/representative/ildiko-gall-pelcz/'> + Ildikó GÃLL-PELCZ </a> </td> @@ -531,14 +531,14 @@ <tr class='representative_item active'> <td class='photo'> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - <img src='http://www.europarl.europa.eu/mepphoto/102886.jpg' width='80' /> + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + <img src='http://www.europarl.europa.eu/mepphoto/96991.jpg' width='80' /> </a> </td> <td> - <a href='/legislature/representative/ildiko-gall-pelcz/'> - Ildikó GÃLL-PELCZ + <a href='/legislature/representative/eider-gardiazabal-rubial/'> + Eider GARDIAZABAL RUBIAL </a> </td> @@ -549,18 +549,18 @@ </a> </td> <td> - <a href='/legislature/representative/country/Hungary/'> - Hungary [HU] + <a href='/legislature/representative/country/Spain/'> + Spain [ES] </a> </td> <td> - <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20European%20People's%20Party%20(Christian%20Democrats)/'> - <span class="group-icon group-icon-epp"></span> EPP + <a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'> + <span class="group-icon group-icon-sd"></span> SD </a> </td> <td> - <span class="label label-danger">-15</span> + <span class="label label-success">15</span> </td> </tr> diff --git a/memopol/views/representative_detail.py b/memopol/views/representative_detail.py index 7b484e348a785357393b8b3cfba9ed483c4497e8..4ced478ae37c826d4f50443c2e1e8b6734b633c1 100644 --- a/memopol/views/representative_detail.py +++ b/memopol/views/representative_detail.py @@ -59,8 +59,9 @@ class RepresentativeDetail(RepresentativeViewMixin, generic.DetailView): c['votes'] = c['object'].votes.all() c['mandates'] = c['object'].mandates.all() - c['positions'] = c['object'].positions.filter( - published=True).prefetch_related('tags') + c['positions'] = c['object'].positions.filter(published=True) \ + .prefetch_related('tags') \ + .order_by('-datetime', 'pk') c['position_form'] = PositionForm( initial={'representative': self.object.pk}) diff --git a/memopol/views/representative_mixin.py b/memopol/views/representative_mixin.py index 55547c693bf6d56371f15e16888109a7d50aa72d..42fe1135aa3ff5c59ed2a139714743c3b53cc11f 100644 --- a/memopol/views/representative_mixin.py +++ b/memopol/views/representative_mixin.py @@ -20,9 +20,9 @@ class RepresentativeViewMixin(object): """ Prefetch Mandates with their Group and Constituency with Country. """ - mandates = Mandate.objects.order_by( - '-end_date').select_related('constituency__country', 'group', - 'group__chamber') + mandates = Mandate.objects.order_by('-end_date', '-begin_date', + 'group__kind', 'group__name').select_related('group', + 'group__chamber', 'constituency__country') return queryset.prefetch_related( models.Prefetch('mandates', queryset=mandates)) diff --git a/representatives_positions/tests/test_functional.py b/representatives_positions/tests/test_functional.py index f134e41c7e1405191b295cf9f293f6bc46ab4f24..aab61d0605a0644e35d952d974373b148a4a5671 100644 --- a/representatives_positions/tests/test_functional.py +++ b/representatives_positions/tests/test_functional.py @@ -34,7 +34,8 @@ class PositionTest(TestCase): assert response['Location'] == expected result = Position.objects.get(text='%stext' % self.id()) - assert list(result.tags.values_list('name', flat=True)) == self.tags + assert list(result.tags.order_by('pk').values_list('name', + flat=True)) == self.tags assert result.datetime == datetime.date(2015, 12, 11) assert result.link == self.fixture['link'] assert result.representative.pk == self.mep.pk diff --git a/setup.py b/setup.py index 4e4c3f17b3a640e7695d22a96a3a50395064c8b2..bce54f365fc45d66000b9640d2f0d0fb946560c6 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ setup(name='political-memory', 'pytz', # Always use up-to-date TZ data 'django-suit>=0.2,<0.3', 'sqlparse>=0.1,<0.2', + 'psycopg2>=2,<3', ], extras_require={ # Full version hardcode for testing dependencies so that