Skip to content

Commit

Permalink
Clean up test_static_dynamic_segments.py so it passes flake8 (#199)
Browse files Browse the repository at this point in the history
* WP-1 clean up tests to pass flake8

* WP-1 undo yapf!
  • Loading branch information
sharrisoncaktus authored and jberghoef committed Mar 16, 2019
1 parent 40a9959 commit 43b5b62
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/test_static_dynamic_segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def test_count_users_matching_static_rules(site, client, mocker, django_user_mod
form = form_with_data(segment, rule)
mocker.patch('wagtail_personalisation.rules.VisitCountRule.test_user', return_value=True)

assert form.count_matching_users([rule], True) is 2
assert form.count_matching_users([rule], True) == 2


@pytest.mark.django_db
Expand All @@ -500,7 +500,7 @@ def test_count_matching_users_excludes_staff(site, client, mocker, django_user_m
form = form_with_data(segment, rule)
mock_test_user = mocker.patch('wagtail_personalisation.rules.VisitCountRule.test_user', return_value=True)

assert form.count_matching_users([rule], True) is 1
assert form.count_matching_users([rule], True) == 1
assert mock_test_user.call_count == 1


Expand All @@ -514,7 +514,7 @@ def test_count_matching_users_excludes_inactive(site, client, mocker, django_use
form = form_with_data(segment, rule)
mock_test_user = mocker.patch('wagtail_personalisation.rules.VisitCountRule.test_user', return_value=True)

assert form.count_matching_users([rule], True) is 1
assert form.count_matching_users([rule], True) == 1
assert mock_test_user.call_count == 1


Expand All @@ -532,7 +532,7 @@ def test_count_matching_users_only_counts_static_rules(site, client, mocker, dja
form = form_with_data(segment, rule)
mock_test_user = mocker.patch('wagtail_personalisation.rules.TimeRule.test_user')

assert form.count_matching_users([rule], True) is 0
assert form.count_matching_users([rule], True) == 0
assert mock_test_user.call_count == 0


Expand All @@ -551,7 +551,7 @@ def test_count_matching_users_handles_match_any(site, client, mocker, django_use
'wagtail_personalisation.rules.VisitCountRule.test_user',
side_effect=[True, False, True, False])

assert form.count_matching_users([first_rule, second_rule], True) is 2
assert form.count_matching_users([first_rule, second_rule], True) == 2
mock_test_user.call_count == 4


Expand All @@ -570,5 +570,5 @@ def test_count_matching_users_handles_match_all(site, client, mocker, django_use
'wagtail_personalisation.rules.VisitCountRule.test_user',
side_effect=[True, True, False, True])

assert form.count_matching_users([first_rule, second_rule], False) is 1
assert form.count_matching_users([first_rule, second_rule], False) == 1
mock_test_user.call_count == 4

0 comments on commit 43b5b62

Please sign in to comment.