From b11d54ded35f46c0ccd072bc37997a34e9fcb5db Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 04 2016 16:01:51 +0000 Subject: Let's find the acl.id automatically instead of hard-coding it --- diff --git a/tests/test_pagure_flask_api_fork.py b/tests/test_pagure_flask_api_fork.py index 916a6a6..9e0ddcd 100644 --- a/tests/test_pagure_flask_api_fork.py +++ b/tests/test_pagure_flask_api_fork.py @@ -368,9 +368,14 @@ class PagureFlaskApiForktests(tests.Modeltests): self.session.commit() # Allow the token to close PR + acls = pagure.lib.get_acls(self.session) + acl = None + for acl in acls: + if acl.name == 'pull_request_close': + break item = pagure.lib.model.TokenAcl( token_id='foobar_token', - acl_id=7, + acl_id=acl.id, ) self.session.add(item) self.session.commit() @@ -477,9 +482,14 @@ class PagureFlaskApiForktests(tests.Modeltests): self.session.commit() # Allow the token to merge PR + acls = pagure.lib.get_acls(self.session) + acl = None + for acl in acls: + if acl.name == 'pull_request_merge': + break item = pagure.lib.model.TokenAcl( token_id='foobar_token', - acl_id=10, + acl_id=acl.id, ) self.session.add(item) self.session.commit()