deprecated all old vue stuff and working on tests

This commit is contained in:
vabene1111
2022-06-07 20:08:32 +02:00
parent 37f0f7a0b7
commit e368488933
22 changed files with 1803 additions and 12510 deletions

View File

@ -13,16 +13,16 @@ DETAIL_URL = 'api:userpreference-detail'
def test_add(u1_s1, u2_s1):
r = u1_s1.post(reverse(LIST_URL))
assert r.status_code == 400
assert r.status_code == 405
with scopes_disabled():
UserPreference.objects.filter(user=auth.get_user(u1_s1)).delete()
r = u2_s1.post(reverse(LIST_URL), {'user': auth.get_user(u1_s1).id, 'plan_share': []}, content_type='application/json')
assert r.status_code == 404
assert r.status_code == 405
r = u1_s1.post(reverse(LIST_URL), {'user': auth.get_user(u1_s1).id, 'plan_share': []}, content_type='application/json')
assert r.status_code == 200
assert r.status_code == 405
def test_preference_list(u1_s1, u2_s1, u1_s2):
@ -51,7 +51,7 @@ def test_preference_retrieve(arg, request, u1_s1):
def test_preference_update(u1_s1, u2_s1):
# can update users preference
r = u1_s1.put(
r = u1_s1.patch(
reverse(
DETAIL_URL,
args={auth.get_user(u1_s1).id}
@ -63,8 +63,8 @@ def test_preference_update(u1_s1, u2_s1):
assert r.status_code == 200
assert response['theme'] == UserPreference.DARKLY
# cant set another users non existent pref
r = u1_s1.put(
# can't set another users non-existent pref
r = u1_s1.patch(
reverse(
DETAIL_URL,
args={auth.get_user(u2_s1).id}
@ -74,11 +74,11 @@ def test_preference_update(u1_s1, u2_s1):
)
assert r.status_code == 404
# cant set another users existent pref
# can't set another users existent pref
with scopes_disabled():
UserPreference.objects.filter(user=auth.get_user(u2_s1)).delete()
r = u1_s1.put(
r = u1_s1.patch(
reverse(
DETAIL_URL,
args={auth.get_user(u2_s1).id}