def test_updatexml_simple(self): Alphabet.objects.create(d='<value>123</value>') Alphabet.objects.update( d=UpdateXML('d', '/value', '<value>456</value>'), ) d = Alphabet.objects.get().d assert d == '<value>456</value>'
def test_updatexml_annotate(self): Alphabet.objects.create(d="<value>123</value>") d2 = ( Alphabet.objects.annotate(d2=UpdateXML("d", "/value", "<value>456</value>")) .get() .d2 ) assert d2 == "<value>456</value>"
def test_updatexml_annotate(self): Alphabet.objects.create(d='<value>123</value>') d2 = Alphabet.objects.annotate( d2=UpdateXML('d', '/value', '<value>456</value>'), ).get().d2 assert d2 == '<value>456</value>'
def test_updatexml_simple(self): Alphabet.objects.create(d="<value>123</value>") Alphabet.objects.update(d=UpdateXML("d", "/value", "<value>456</value>")) d = Alphabet.objects.get().d assert d == "<value>456</value>"
def test_updatexml_expressions(self): Alphabet.objects.create(d="<value>123</value>") Alphabet.objects.update( d=UpdateXML("d", Value("/value"), Value("<value>456</value>"))) d = Alphabet.objects.get().d assert d == "<value>456</value>"