summaryrefslogtreecommitdiff
path: root/django/test/utils.py
diff options
context:
space:
mode:
authorWill Ayd <william.ayd@icloud.com>2017-12-01 11:00:45 -0500
committerTim Graham <timograham@gmail.com>2018-01-08 20:57:33 -0500
commit09530e61a0035192ca8bcdebc5ead13d14c16eb0 (patch)
treecd9b31edf7f69adf3e64ae0e54e31a37e92914a5 /django/test/utils.py
parentacd3baf2ae3f74846731447df66e8c3ce7a772f7 (diff)
downloaddjango-09530e61a0035192ca8bcdebc5ead13d14c16eb0.tar.gz
Fixed #28869 -- Made tagged test classes and methods inherit tags from parents.
Diffstat (limited to 'django/test/utils.py')
-rw-r--r--django/test/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index 1a1b78f34d..cbefaf0e09 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -831,6 +831,9 @@ class isolate_apps(TestContextDecorator):
def tag(*tags):
"""Decorator to add tags to a test class or method."""
def decorator(obj):
- setattr(obj, 'tags', set(tags))
+ if hasattr(obj, 'tags'):
+ obj.tags = obj.tags.union(tags)
+ else:
+ setattr(obj, 'tags', set(tags))
return obj
return decorator