mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot_merge: testing of batch contents
* Add ids accessor to the remote Model fake * Explicitly ignore order when unnecessary, a test fails since the ordering of prs has been changed for UI purposes. This is only an issue for Remote though it's unclear why (as the local Issue/PR objects should still have a per-repo sequence)
This commit is contained in:
parent
a15ab1c481
commit
63be381453
@ -303,6 +303,10 @@ class Model:
|
||||
|
||||
object.__setattr__(self, '_fields', fields or self._env(self._model, 'fields_get', attributes=['type', 'relation']))
|
||||
|
||||
@property
|
||||
def ids(self):
|
||||
return self._ids
|
||||
|
||||
def __bool__(self):
|
||||
return bool(self._ids)
|
||||
|
||||
|
@ -172,8 +172,7 @@ def test_merge_fail(env, project, repo_a, repo_b, users):
|
||||
|
||||
s2 = to_pr(env, pr2a) | to_pr(env, pr2b)
|
||||
st = env['runbot_merge.stagings'].search([])
|
||||
assert st
|
||||
assert st.batch_ids.prs == s2
|
||||
assert set(st.batch_ids.prs.ids) == set(s2.ids)
|
||||
|
||||
failed = to_pr(env, pr1b)
|
||||
assert failed.state == 'error'
|
||||
|
Loading…
Reference in New Issue
Block a user