def test_admin_user_configuration(self): config = self._get_configuration(admin=True) assert_has_keys(config, *TEST_KEYS_FOR_ALL_USERS) assert_has_keys(config, *TEST_KEYS_FOR_ADMIN_ONLY)
def check_role_dict(role_dict, assert_id=None): assert_has_keys(role_dict, "id", "name", "model_class", "url") assert role_dict["model_class"] == "Role" if assert_id is not None: assert role_dict["id"] == assert_id
def test_normal_user_configuration(self): config = self._get_configuration() assert_has_keys(config, *TEST_KEYS_FOR_ALL_USERS) assert_not_has_keys(config, *TEST_KEYS_FOR_ADMIN_ONLY)
def _assert_has_keys(self, response, *keys): assert_has_keys(response, *keys)