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

Method test_textfield

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

Source from the content-addressed store, hash-verified

85 )
86
87 def test_textfield(self):
88 Article.objects.create(
89 title="The Title",
90 text="x" * 4000,
91 written=timezone.now(),
92 )
93 obj = Article.objects.annotate(json_object=JSONObject(text=F("text"))).first()
94 self.assertEqual(obj.json_object, {"text": "x" * 4000})
95
96 def test_order_by_key(self):
97 qs = Author.objects.annotate(attrs=JSONObject(alias=F("alias"))).order_by(

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected