diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/test/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/django/test/utils.py b/django/test/utils.py index d178c9b29c..be586c75a6 100644 --- a/django/test/utils.py +++ b/django/test/utils.py @@ -60,6 +60,16 @@ class ContextList(list): return False return True + def keys(self): + """ + Flattened keys of subcontexts. + """ + keys = set() + for subcontext in self: + for dict in subcontext: + keys |= set(dict.keys()) + return keys + def instrumented_test_render(self, context): """ |
