Skip to content
Permalink
Browse files

Allow multiple primary key fields to be specified for processing tests

`
  • Loading branch information
nyalldawson committed Sep 8, 2017
1 parent c750cb2 commit e9fd4095521c8a5e641f7494911dd4af5f6785ac
Showing with 5 additions and 1 deletion.
  1. +5 −1 python/testing/__init__.py
@@ -105,7 +105,11 @@ def checkLayersEqual(self, layer_expected, layer_result, use_asserts=False, **kw

def sort_by_pk_or_fid(f):
if 'pk' in kwargs and kwargs['pk'] is not None:
return f[kwargs['pk']]
key = kwargs['pk']
if isinstance(key, list) or isinstance(key, tuple):
return [f[k] for k in key]
else:
return f[kwargs['pk']]
else:
return f.id()

0 comments on commit e9fd409

Please sign in to comment.
You can’t perform that action at this time.