Adjust test to internal type change

This commit is contained in:
Raphael Michel
2019-04-05 14:59:05 +02:00
parent f3128591d8
commit dd0b6e6647
2 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -31,10 +31,10 @@ class PluginsField(Field):
def to_representation(self, obj):
from pretix.base.plugins import get_all_plugins
return [
return sorted([
p.module for p in get_all_plugins()
if not p.name.startswith('.') and getattr(p, 'visible', True) and p.module in obj.get_plugins()
]
])
def to_internal_value(self, data):
return {
+5 -5
View File
@@ -89,10 +89,10 @@ TEST_EVENT_RES = {
"slug": "dummy",
"has_subevents": False,
"meta_data": {"type": "Conference"},
'plugins': {
'plugins': [
'pretix.plugins.banktransfer',
'pretix.plugins.ticketoutputpdf'
}
]
}
@@ -573,7 +573,7 @@ def test_event_update_plugins(token_client, organizer, event, free_item, free_qu
format='json'
)
assert resp.status_code == 200
assert resp.data.get('plugins') == {
assert set(resp.data.get('plugins')) == {
"pretix.plugins.ticketoutputpdf",
"pretix.plugins.pretixdroid"
}
@@ -588,9 +588,9 @@ def test_event_update_plugins(token_client, organizer, event, free_item, free_qu
format='json'
)
assert resp.status_code == 200
assert resp.data.get('plugins') == {
assert resp.data.get('plugins') == [
"pretix.plugins.banktransfer"
}
]
resp = token_client.patch(
'/api/v1/organizers/{}/events/{}/'.format(organizer.slug, event.slug),