MCPcopy
hub / github.com/django/django / test_textfield

Method test_textfield

tests/db_functions/json/test_json_array.py:80–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

78 )
79
80 def test_textfield(self):
81 Article.objects.create(
82 title="The Title",
83 text="x" * 4000,
84 written=timezone.now(),
85 )
86 obj = Article.objects.annotate(json_array=JSONArray(F("text"))).first()
87 self.assertEqual(obj.json_array, ["x" * 4000])
88
89 @unittest.skipUnless(connection.vendor == "postgresql", "PostgreSQL specific tests")
90 def test_explicit_cast(self):

Callers

nothing calls this directly

Calls 6

JSONArrayClass · 0.90
FClass · 0.90
firstMethod · 0.80
annotateMethod · 0.80
createMethod · 0.45
nowMethod · 0.45

Tested by

no test coverage detected