MCPcopy
hub / github.com/django/django / test_set_field_to_null

Method test_set_field_to_null

tests/queries/test_bulk_update.py:97–103  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

95 self.assertSequenceEqual(Note.objects.filter(tag__isnull=False), self.notes)
96
97 def test_set_field_to_null(self):
98 self.create_tags()
99 Note.objects.update(tag=self.tags[0])
100 for note in self.notes:
101 note.tag = None
102 Note.objects.bulk_update(self.notes, ["tag"])
103 self.assertCountEqual(Note.objects.filter(tag__isnull=True), self.notes)
104
105 def test_set_mixed_fields_to_null(self):
106 self.create_tags()

Callers

nothing calls this directly

Calls 4

create_tagsMethod · 0.95
updateMethod · 0.45
bulk_updateMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected