diff --git a/bioblend/_tests/TestGalaxyUsers.py b/bioblend/_tests/TestGalaxyUsers.py index 9e50682c5..4f89ce0e7 100644 --- a/bioblend/_tests/TestGalaxyUsers.py +++ b/bioblend/_tests/TestGalaxyUsers.py @@ -53,13 +53,18 @@ def test_create_local_user(self): # test a BioBlend GalaxyInstance can be created using username+password user_gi = bioblend.galaxy.GalaxyInstance(url=self.gi.base_url, email=new_user_email, password=password) assert user_gi.users.get_current_user()["email"] == new_user_email - # test deletion + # test deletion and purging assert self.gi.config.get_config()["allow_user_deletion"] if self.gi.config.get_config()["allow_user_deletion"]: deleted_user = self.gi.users.delete_user(new_user["id"]) assert deleted_user["email"] == new_user_email assert deleted_user["deleted"] + purged_user = self.gi.users.delete_user(new_user["id"], purge=True) + assert purged_user["email"] == new_user_email + assert purged_user["deleted"] + assert purged_user["purged"] + def test_get_current_user(self): user = self.gi.users.get_current_user() assert user["id"] is not None @@ -86,9 +91,11 @@ def test_update_user(self): assert updated_user["username"] == updated_username assert updated_user["email"] == updated_user_email - assert self.gi.config.get_config()["allow_user_deletion"] + # delete user after test (if possile), also tests purging without prior deletion if self.gi.config.get_config()["allow_user_deletion"]: - self.gi.users.delete_user(new_user_id) + purged_user = self.gi.users.delete_user(new_user_id, purge=True) + assert purged_user["deleted"] + assert purged_user["purged"] def test_get_user_apikey(self): # Test getting the API key of the current user, which surely has one