Blacked the code

This commit is contained in:
Eliot Berriot 2018-06-09 15:36:16 +02:00
parent b6fc0051fa
commit 62ca3bd736
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
279 changed files with 8861 additions and 9527 deletions

View file

@ -6,12 +6,13 @@ from dynamic_preferences.api import serializers
def test_can_list_settings_via_api(preferences, api_client):
url = reverse('api:v1:instance:settings')
url = reverse("api:v1:instance:settings")
all_preferences = preferences.model.objects.all()
expected_preferences = {
p.preference.identifier(): p
for p in all_preferences
if getattr(p.preference, 'show_in_api', False)}
if getattr(p.preference, "show_in_api", False)
}
assert len(expected_preferences) > 0
@ -20,15 +21,18 @@ def test_can_list_settings_via_api(preferences, api_client):
assert len(response.data) == len(expected_preferences)
for p in response.data:
i = '__'.join([p['section'], p['name']])
i = "__".join([p["section"], p["name"]])
assert i in expected_preferences
@pytest.mark.parametrize('pref,value', [
('instance__name', 'My instance'),
('instance__short_description', 'For music lovers'),
('instance__long_description', 'For real music lovers'),
])
@pytest.mark.parametrize(
"pref,value",
[
("instance__name", "My instance"),
("instance__short_description", "For music lovers"),
("instance__long_description", "For real music lovers"),
],
)
def test_instance_settings(pref, value, preferences):
preferences[pref] = value