#22683: Schema tests and .extra queryset method
-------------------------------+--------------------
     Reporter:  maxi           |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Migrations     |    Version:  1.6
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Running schema tests I caught an issue, more precisely, in
 test_add_field_default_transform.
 At the end, this test method is doing:

 self.assertEqual(Author.objects.extra(where=["thing = 1"]).count(), 2)

 The problem here is what in this where clause, the "thing" field must be
 quoted.

 In firebird :

     SELECT * FROM AUTHOR WHERE thing = 1   <-- Here thing (in lowercase)
 and THING (in uppercase) are equivalent, are the same object

 is different of:

     SELECT * FROM AUTHOR WHERE "thing" = 1   <--  field is quoted

 For a more generic test I think we need to avoid use .extra method or
 another raw sql statement.

 For a more complete discussion about it, see at
 https://groups.google.com/forum/?hl=es#!topic/django-
 developers/KRHD77KlZ28

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22683>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/047.c16a63acc5c006dcfe19241ef5fd3f43%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to