Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
sfermigier committed Jul 9, 2018
1 parent 7237391 commit 75eade0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions abilian/services/vocabularies/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,36 +137,33 @@ def test_admin_panel_reorder(app, db, session, client, test_request_context):
data.update(base_data)
r = client.post(url, data=data)
assert r.status_code == 302
assert path_from_url(r.headers["Location"]) == "/admin/vocabularies"
assert path_from_url(r.location) == "/admin/vocabularies"
assert Voc.query.order_by(Voc.position).all() == [second, first, third]

data = {"up": first.id, "return_to": "group"}
data.update(base_data)
r = client.post(url, data=data)
assert r.status_code == 302
assert path_from_url(r.headers["Location"]) == "/admin/vocabularies/_/"
assert path_from_url(r.location) == "/admin/vocabularies/_/"
assert Voc.query.order_by(Voc.position).all() == [first, second, third]

data = {"up": first.id, "return_to": "model"}
data.update(base_data)
r = client.post(url, data=data)
assert r.status_code == 302
assert (
path_from_url(r.headers["Location"])
== "/admin/vocabularies/_/defaultstates/"
)
assert path_from_url(r.location) == "/admin/vocabularies/_/defaultstates/"
assert Voc.query.order_by(Voc.position).all() == [first, second, third]

data = {"down": third.id}
data.update(base_data)
r = client.post(url, data=data)
assert r.status_code == 302
assert path_from_url(r.headers["Location"]) == "/admin/vocabularies"
assert path_from_url(r.location) == "/admin/vocabularies"
assert Voc.query.order_by(Voc.position).all() == [first, second, third]

data = {"up": third.id}
data.update(base_data)
r = client.post(url, data=data)
assert r.status_code == 302
assert path_from_url(r.headers["Location"]) == "/admin/vocabularies"
assert path_from_url(r.location) == "/admin/vocabularies"
assert Voc.query.order_by(Voc.position).all() == [first, third, second]
1 change: 1 addition & 0 deletions abilian/testing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"cleanup_db",
"client_login",
"login",
"path_from_url",
)


Expand Down
2 changes: 1 addition & 1 deletion abilian/testing/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

SKIPPED_PATHS = [
# FIXME: later
("admin", "settings"),
("admin", "settings")
]


Expand Down

0 comments on commit 75eade0

Please sign in to comment.