Skip to content

Commit

Permalink
Switch to set method for modifying manytomany fields
Browse files Browse the repository at this point in the history
  • Loading branch information
albertyw committed Dec 22, 2017
1 parent c16b1ae commit 1b7ec90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion project/tests/test_lib/mock_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import random
import traceback

import django
from django.core import management
from django.utils import timezone

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 1b7ec90

Please sign in to comment.