summaryrefslogtreecommitdiff
path: root/tests/many_to_one_null
diff options
context:
space:
mode:
Diffstat (limited to 'tests/many_to_one_null')
-rw-r--r--tests/many_to_one_null/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/many_to_one_null/tests.py b/tests/many_to_one_null/tests.py
index 77b8fd7c25..6ccabefe66 100644
--- a/tests/many_to_one_null/tests.py
+++ b/tests/many_to_one_null/tests.py
@@ -85,6 +85,11 @@ class ManyToOneNullTests(TestCase):
['<Article: Fourth>', '<Article: Second>', '<Article: Third>']
)
+ def test_set_clear_non_bulk(self):
+ # 2 queries for clear(), 1 for add(), and 1 to select objects.
+ with self.assertNumQueries(4):
+ self.r.article_set.set([self.a], bulk=False, clear=True)
+
def test_assign_clear_related_set(self):
# Use descriptor assignment to allocate ForeignKey. Null is legal, so
# existing members of the set that are not in the assignment set are