forked from Github-Mirrors/canaille
unit test explicit object reloading
This commit is contained in:
parent
4d64b3fcba
commit
61f2280f34
2 changed files with 5 additions and 0 deletions
|
@ -120,6 +120,7 @@ def test_set_groups_with_leading_space_in_user_id_attribute(app, foo_group):
|
||||||
user.groups = [foo_group]
|
user.groups = [foo_group]
|
||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
|
foo_group.reload()
|
||||||
assert user in foo_group.members
|
assert user in foo_group.members
|
||||||
|
|
||||||
user.groups = []
|
user.groups = []
|
||||||
|
|
|
@ -89,6 +89,7 @@ def test_password_change(testclient, logged_user):
|
||||||
|
|
||||||
res = res.form.submit(name="action", value="edit").follow()
|
res = res.form.submit(name="action", value="edit").follow()
|
||||||
|
|
||||||
|
logged_user.reload()
|
||||||
assert logged_user.check_password("new_password")
|
assert logged_user.check_password("new_password")
|
||||||
|
|
||||||
res = testclient.get("/profile/user/settings", status=200)
|
res = testclient.get("/profile/user/settings", status=200)
|
||||||
|
@ -100,6 +101,7 @@ def test_password_change(testclient, logged_user):
|
||||||
assert ("success", "Profile updated successfuly.") in res.flashes
|
assert ("success", "Profile updated successfuly.") in res.flashes
|
||||||
res = res.follow()
|
res = res.follow()
|
||||||
|
|
||||||
|
logged_user.reload()
|
||||||
assert logged_user.check_password("correct horse battery staple")
|
assert logged_user.check_password("correct horse battery staple")
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,6 +113,7 @@ def test_password_change_fail(testclient, logged_user):
|
||||||
|
|
||||||
res = res.form.submit(name="action", value="edit", status=200)
|
res = res.form.submit(name="action", value="edit", status=200)
|
||||||
|
|
||||||
|
logged_user.reload()
|
||||||
assert logged_user.check_password("correct horse battery staple")
|
assert logged_user.check_password("correct horse battery staple")
|
||||||
|
|
||||||
res = testclient.get("/profile/user/settings", status=200)
|
res = testclient.get("/profile/user/settings", status=200)
|
||||||
|
@ -120,6 +123,7 @@ def test_password_change_fail(testclient, logged_user):
|
||||||
|
|
||||||
res = res.form.submit(name="action", value="edit", status=200)
|
res = res.form.submit(name="action", value="edit", status=200)
|
||||||
|
|
||||||
|
logged_user.reload()
|
||||||
assert logged_user.check_password("correct horse battery staple")
|
assert logged_user.check_password("correct horse battery staple")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue