Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Aug 4, 2022
1 parent 5268c87 commit 076803d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion admin_tests/mixins/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def test_context_data(self, provider_one, provider_two, view, provider_class):
view.object_list = view.get_queryset()
res = view.get_context_data()
assert isinstance(res, dict)
assert len(res[f'{provider_one.readable_type}_providers']) == 2
if isinstance(provider_one, RegistrationProvider):
assert len(res[f'{provider_one.readable_type}_providers']) == 3 # 2 test providers + 1 for the default provider
else:
assert len(res[f'{provider_one.readable_type}_providers']) == 2

assert isinstance(res['{}_providers'.format(provider_one.readable_type)][0], provider_class)

Expand Down
5 changes: 4 additions & 1 deletion api_tests/providers/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,10 @@ def test_provider_list_filtering(
res = app.get('{}?filter[{}]={}'.format(
url, filter_type, filter_value))
assert res.status_code == 200
assert len(res.json['data']) == 1
if isinstance(provider_one, RegistrationProvider) and filter_type == 'allow_submissions':
assert len(res.json['data']) == 2 # 1 test provider +1 for default provider
else:
assert len(res.json['data']) == 1

class ProviderDetailViewTestBaseMixin(ProviderExistsMixin):

Expand Down

0 comments on commit 076803d

Please sign in to comment.