Following test cases requires to check can_defer_constraint_checks
i) test cases under admin_views.tests.AdminViewDeletedObjectsTest test
class
ii) test cases under serializers_regress.tests.SerializerTests test class
Following test cases requires supports_forward_references flag check
i) serializers.SerializersTransactionTestBase.test_forward_refs
ii)
fixtures_regress.TestFixtures.test_loaddata_works_when_fixture_has_forward_refs
iii)
fixtures_regress.TestFixtures.test_loaddata_forward_refs_split_fixtures
--
Ticket URL: <https://code.djangoproject.com/ticket/22653>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:1>
Comment (by manfre):
Why does the patch use `skipUnlessDBFeature` in some places and
`skipUnless` in others? Why not always use `skipUnlessDBFeature`?
--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:2>
Comment (by rahul.priyadarshi@…):
Yes, It would be good if always use {{{skipUnlessDBFeature}}}. In new
attached patch(patch2.diff) I have made this modification.
--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:3>
Comment (by timo):
Couple of things I noticed:
* The MySQL backend has `supports_forward_references=False`
([https://github.com/django/django/commit/121d2e36#diff-
dbe1511db54b8fff2cb72a199cf37b4cR127 blamed to 121d2e36]), but after
removing that (which changes it to True) the tests still pass (i.e. the
existing test that has
`@skipUnlessDBFeature('supports_forward_references')` is currently skipped
on MySQL, but works fine). This issue is not necessarily related to this
patch, except that additional tests that current pass on MySQL will be
skipped. I'm not sure if `supports_forward_references=False` can be
removed or if maybe it is only relevant for particular versions and/or
storage engines in MySQL.
* MySQL + SQLite have `can_defer_constraint_checks=False` but
`admin_views.tests.AdminViewDeletedObjectsTest` and
`serializers_regress.tests.SerializerTests` current pass (the patch would
cause them to be skipped).
--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:4>
Comment (by rahul.priyadarshi@…):
MySQL + SQLite can defer the constraint checking and can support forward
reference until the end of the transaction. These test cases doing all the
operation within a transaction only that's why these test case passes with
MySQL+SQLite.
But it is not in case of dtatabse like DB2, which strictly follow
constraint checking and can't defer it within a transaction also.
--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:5>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"99f5ea9cc8f41724e07b88c6142d0092961ce5e0"]:
{{{
#!CommitTicketReference repository=""
revision="99f5ea9cc8f41724e07b88c6142d0092961ce5e0"
Fixed #22653 -- Added some database feature flags to tests.
Thanks Rahul Priyadarshi.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"45e47f7b95aad98d91bb40e19dda14ae120980a4"]:
{{{
#!CommitTicketReference repository=""
revision="45e47f7b95aad98d91bb40e19dda14ae120980a4"
[1.7.x] Fixed #22653 -- Added some database feature flags to tests.
Thanks Rahul Priyadarshi.
Backport of 99f5ea9cc8 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:7>