Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Political Memory
memopol
Commits
1bf6d1e4
Commit
1bf6d1e4
authored
Aug 09, 2016
by
Nicolas Joyard
Browse files
Skip tests pending v3 integration
parent
7792105c
Changes
8
Hide whitespace changes
Inline
Side-by-side
memopol/tests/test_dossiers.py
View file @
1bf6d1e4
# -*- coding: utf-8 -*-
import
pytest
from
django.test
import
TestCase
from
representatives_votes.models
import
Dossier
...
...
@@ -10,6 +12,7 @@ from .base import ResponseDiffMixin
class
DossiersTest
(
ResponseDiffMixin
,
TestCase
):
fixtures
=
[
'smaller_sample.json'
]
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_dossier_list
(
self
):
# session setup
self
.
client
.
get
(
'/votes/dossier/'
)
...
...
@@ -23,6 +26,7 @@ class DossiersTest(ResponseDiffMixin, TestCase):
# 1 query for document chambers
self
.
responsediff_test
(
'/votes/dossier/'
,
7
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_dossier_search
(
self
):
# session setup
self
.
client
.
get
(
'/votes/dossier/'
)
...
...
@@ -37,6 +41,7 @@ class DossiersTest(ResponseDiffMixin, TestCase):
q
=
'acta'
self
.
responsediff_test
(
'/votes/dossier/?search=%s'
%
q
,
7
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_dossier_search_noresults
(
self
):
# session setup
self
.
client
.
get
(
'/votes/dossier/'
)
...
...
@@ -47,6 +52,7 @@ class DossiersTest(ResponseDiffMixin, TestCase):
q
=
'no-dossier-will-have-that-title-ever'
self
.
responsediff_test
(
'/votes/dossier/?search=%s'
%
q
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_dossier_sorting
(
self
):
# session setup
self
.
client
.
get
(
'/votes/dossier/?sort_by=title&sort_dir=desc'
)
...
...
@@ -60,6 +66,7 @@ class DossiersTest(ResponseDiffMixin, TestCase):
# 1 query for document chambers
self
.
responsediff_test
(
'/votes/dossier/'
,
7
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_dossier_detail
(
self
):
# Get 1st dossier in dataset
dossier
=
Dossier
.
objects
.
order_by
(
'pk'
)[
0
]
...
...
memopol/tests/test_dossiers_detail.py
View file @
1bf6d1e4
import
pytest
from
django.test
import
TestCase
from
.base
import
UrlGetTestMixin
...
...
@@ -7,6 +9,7 @@ class DossierDetailTest(UrlGetTestMixin, TestCase):
fixtures
=
[
'smaller_sample.json'
]
url
=
'/votes/dossier/28147/'
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_num_queries
(
self
):
"""
1) fetch the dossier
...
...
@@ -21,14 +24,18 @@ class DossierDetailTest(UrlGetTestMixin, TestCase):
with
self
.
assertNumQueries
(
4
):
self
.
client
.
get
(
self
.
url
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_title_display
(
self
):
self
.
assertHtmlInResult
(
"<h1 class='text-center'>Dossier Resolution on the Anti-Counterfeiting Trade Agreement (ACTA)</h1>"
)
# noqa
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_date_display
(
self
):
self
.
assertHtmlInResult
(
"<p class='lead text-center'>Last updated Dec. 27, 2015</p>"
)
# noqa
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_description_display
(
self
):
self
.
assertExpectedHtmlInResult
()
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_votes_display
(
self
):
self
.
assertExpectedHtmlInResult
()
memopol/tests/test_dossiers_list.py
View file @
1bf6d1e4
import
pytest
from
django.test
import
TestCase
from
.base
import
UrlGetTestMixin
...
...
@@ -7,6 +9,7 @@ class DossiersListTest(UrlGetTestMixin, TestCase):
fixtures
=
[
'smaller_sample.json'
]
url
=
'/votes/dossier/'
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_num_queries
(
self
):
"""
1) fetch the total dossiers count for the paginator
...
...
@@ -27,5 +30,6 @@ class DossiersListTest(UrlGetTestMixin, TestCase):
def
test_dossier_age
(
self
):
self
.
assertHtmlInResult
(
'<p class="text-center">Last updated Dec. 27, 2015</p>'
)
# noqa
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_dossier_votes
(
self
):
self
.
assertHtmlInResult
(
'<span class="badge">106</span>'
)
memopol/tests/test_group_list.py
View file @
1bf6d1e4
# -*- coding: utf-8 -*-
import
pytest
from
django.test
import
TestCase
from
.base
import
ResponseDiffMixin
...
...
@@ -16,41 +18,49 @@ class GroupListTest(ResponseDiffMixin, TestCase):
self
.
responsediff_test
(
url
,
numQueries
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_chambers
(
self
):
# 1 query for chambers
# 1 query for pagination
self
.
group_test
(
'chamber'
,
1
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_country
(
self
):
# 1 query for countries
# 1 query for pagination
self
.
group_test
(
'country'
,
1
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_active_parties
(
self
):
# 1 query for political groups
# 1 query for pagination
self
.
group_test
(
'group'
,
1
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_all_parties
(
self
):
# 1 query for political groups
# 1 query for pagination
self
.
group_test
(
'group'
,
0
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_active_delegations
(
self
):
# 1 query for delegations
# 1 query for pagination
self
.
group_test
(
'delegation'
,
1
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_all_delegations
(
self
):
# 1 query for delegations
# 1 query for pagination
self
.
group_test
(
'delegation'
,
0
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_active_committees
(
self
):
# 1 query for committees
# 1 query for pagination
self
.
group_test
(
'committee'
,
1
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_all_committees
(
self
):
# 1 query for committees
# 1 query for pagination
...
...
memopol/tests/test_representatives_detail.py
View file @
1bf6d1e4
# -*- coding: utf-8 -*-
import
pytest
from
django.test
import
TestCase
from
.base
import
UrlGetTestMixin
...
...
@@ -8,6 +11,7 @@ class RepresentativeDetailTest(UrlGetTestMixin, TestCase):
fixtures
=
[
'one_representative'
]
url
=
'/legislature/representative/mary-honeyball-1952-11-12/'
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_num_queries
(
self
):
# Ensure one-time cached queries occur before the actual test
self
.
client
.
get
(
self
.
url
)
...
...
@@ -34,10 +38,12 @@ class RepresentativeDetailTest(UrlGetTestMixin, TestCase):
def
test_score_display
(
self
):
self
.
assertExpectedHtmlInResult
()
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_country_display
(
self
):
self
.
assertHtmlInResult
(
'<span class="flag-icon flag-icon-gb"></span> United Kingdom'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_current_mandate_display
(
self
):
expected
=
''
.
join
((
"<a href='/legislature/representative/group/European%20Parliament/Group%20of%20the%20Progressive%20Alliance%20of%20Socialists%20and%20Democrats%20in%20the%20European%20Parliament/'>"
,
# noqa
...
...
@@ -50,11 +56,14 @@ class RepresentativeDetailTest(UrlGetTestMixin, TestCase):
def
test_biography_display
(
self
):
self
.
assertHtmlInResult
(
'Born in Weymouth the 12/11/1952 (F)'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_votes_display
(
self
):
self
.
assertExpectedHtmlInResult
()
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_mandates_display
(
self
):
self
.
assertExpectedHtmlInResult
()
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_positions_display
(
self
):
self
.
assertExpectedHtmlInResult
()
memopol/tests/test_representatives_list.py
View file @
1bf6d1e4
# -*- coding: utf-8 -*-
import
pytest
from
django.test
import
TestCase
from
responsediff.response
import
Response
...
...
@@ -78,27 +80,35 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
expected
=
Response
.
for_test
(
self
)
expected
.
assertNoDiff
(
self
.
response
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_page1_paginateby12_active_displaylist
(
self
):
self
.
functional_test
(
1
,
12
,
1
,
'list'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_page1_paginateby12_all_displaylist
(
self
):
self
.
functional_test
(
1
,
12
,
0
,
'list'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_page1_paginateby24_active_displaygrid
(
self
):
self
.
functional_test
(
1
,
24
,
1
,
'grid'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_page1_paginateby24_all_displaygrid
(
self
):
self
.
functional_test
(
1
,
24
,
0
,
'grid'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_page2_paginateby24_displaylist
(
self
):
self
.
functional_test
(
2
,
24
,
1
,
'list'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_page1_paginateby12_displaylist_searchjoly
(
self
):
self
.
functional_test
(
1
,
12
,
1
,
'list'
,
'joly'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_page2_paginateby12_displaylist
(
self
):
self
.
functional_test
(
2
,
12
,
1
,
'list'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_filter_search
(
self
):
"""
- A count for pagination
...
...
@@ -109,6 +119,7 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
"""
self
.
filter_test
(
5
,
'am'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_filter_country
(
self
):
"""
5 same queries as test_filter_search plus:
...
...
@@ -116,6 +127,7 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
"""
self
.
filter_test
(
6
,
''
,
110
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_filter_chamber
(
self
):
"""
5 same queries as test_filter_search plus:
...
...
@@ -123,6 +135,7 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
"""
self
.
filter_test
(
6
,
''
,
''
,
1
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_filter_group
(
self
):
"""
5 same queries as test_filter_search plus:
...
...
@@ -131,6 +144,7 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
"""
self
.
filter_test
(
7
,
''
,
''
,
''
,
17
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_filter_multiple
(
self
):
"""
5 same queries as test_filter_search plus:
...
...
@@ -141,6 +155,7 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
"""
self
.
filter_test
(
9
,
'e'
,
110
,
1
,
17
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_filter_notfound
(
self
):
"""
Same queries as test_filter_search minus those two :
...
...
@@ -150,6 +165,7 @@ class RepresentativeListTest(UrlGetTestMixin, TestCase):
"""
self
.
filter_test
(
3
,
'non-existing-rep-name'
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_sorting
(
self
):
"""
- A count for pagination
...
...
memopol/tests/test_themes.py
View file @
1bf6d1e4
# -*- coding: utf-8 -*-
import
pytest
from
django.test
import
TestCase
from
memopol_themes.models
import
Theme
...
...
@@ -10,6 +12,7 @@ from .base import ResponseDiffMixin
class
ThemesTest
(
ResponseDiffMixin
,
TestCase
):
fixtures
=
[
'smaller_sample.json'
]
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_theme_list
(
self
):
# session setup
self
.
client
.
get
(
'/theme/'
)
...
...
@@ -18,6 +21,7 @@ class ThemesTest(ResponseDiffMixin, TestCase):
# 1 query for themes
self
.
responsediff_test
(
'/theme/'
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_theme_search
(
self
):
# session setup
self
.
client
.
get
(
'/theme/'
)
...
...
@@ -27,6 +31,7 @@ class ThemesTest(ResponseDiffMixin, TestCase):
q
=
'acta'
self
.
responsediff_test
(
'/theme/?search=%s'
%
q
,
2
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_theme_search_noresults
(
self
):
# session setup
self
.
client
.
get
(
'/theme/'
)
...
...
@@ -36,6 +41,7 @@ class ThemesTest(ResponseDiffMixin, TestCase):
q
=
'no-theme-will-have-that-title-ever'
self
.
responsediff_test
(
'/theme/?search=%s'
%
q
,
1
)
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_theme_detail
(
self
):
# Get 1st theme in dataset
theme
=
Theme
.
objects
.
order_by
(
'pk'
)[
0
]
...
...
representatives_positions/tests/test_functional.py
View file @
1bf6d1e4
import
datetime
import
copy
import
pytest
from
django.core.urlresolvers
import
reverse
from
django.test
import
TestCase
,
Client
...
...
@@ -37,6 +38,7 @@ class PositionTest(TestCase):
assert
result
.
representative
.
pk
==
self
.
mep
.
pk
assert
result
.
published
is
False
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_position_publishing
(
self
):
response
=
self
.
client
.
post
(
self
.
create_url
,
self
.
fixture
)
assert
response
.
status_code
==
302
...
...
@@ -51,6 +53,7 @@ class PositionTest(TestCase):
get_response
=
self
.
client
.
get
(
position
.
get_absolute_url
())
assert
get_response
.
status_code
==
200
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_create_position_without_field
(
self
):
for
key
in
self
.
fixture
.
keys
():
fixture
=
copy
.
copy
(
self
.
fixture
)
...
...
@@ -60,6 +63,7 @@ class PositionTest(TestCase):
assert
response
.
context
[
'form'
].
is_valid
()
is
False
,
\
'Could submit form without %s'
%
key
@
pytest
.
mark
.
skip
(
reason
=
"pending design v3 migration"
)
def
test_position_detail
(
self
):
position
=
Position
.
objects
.
create
(
published
=
True
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment