diff --git a/project/tests/test_lib/mock_suite.py b/project/tests/test_lib/mock_suite.py index 64be9271..18924fae 100644 --- a/project/tests/test_lib/mock_suite.py +++ b/project/tests/test_lib/mock_suite.py @@ -5,6 +5,7 @@ import random import traceback +import django from django.core import management from django.utils import timezone @@ -100,7 +101,10 @@ def mock_sql_queries(self, request=None, profile=None, n=1, as_dict=False): for q in queries: profile['queries'].append(q) else: - profile.queries = queries + if django.VERSION >= (1, 9): + profile.queries.set(queries) + else: + profile.queries = queries profile.save() return queries