[Django] #22653: Need to add database features flag in some of the test cases

20 views
Skip to first unread message

Django

unread,
May 19, 2014, 6:47:35 AM5/19/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+------------------------
Reporter: rahul.priyadarshi@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: 1.7-beta-2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------
Some of the Database backend doesn't allow to defer constraints check like
DB2 which doesn't allow to defer constraint check within a transaction
also

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.

Django

unread,
May 19, 2014, 7:58:24 AM5/19/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+-------------------------------------

Reporter: rahul.priyadarshi@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version:
Severity: Normal | 1.7-beta-2
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Accepted
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* needs_docs: => 0
* needs_better_patch: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22653#comment:1>

Django

unread,
May 19, 2014, 11:07:31 AM5/19/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+-------------------------------------

Reporter: rahul.priyadarshi@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version:
Severity: Normal | 1.7-beta-2
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Accepted
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 19, 2014, 4:13:47 PM5/19/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+-------------------------------------

Reporter: rahul.priyadarshi@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version:
Severity: Normal | 1.7-beta-2
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Accepted
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 23, 2014, 11:15:05 AM5/23/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+-------------------------------------

Reporter: rahul.priyadarshi@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version:
Severity: Normal | 1.7-beta-2
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Accepted
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
May 26, 2014, 6:27:46 AM5/26/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+-------------------------------------

Reporter: rahul.priyadarshi@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version:
Severity: Normal | 1.7-beta-2
Keywords: | Resolution:
Has patch: 1 | Triage Stage: Accepted
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Jun 11, 2014, 11:46:37 AM6/11/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+-------------------------------------
Reporter: rahul.priyadarshi@… | Owner: nobody
Type: Uncategorized | Status: closed

Component: Testing framework | Version:
Severity: Normal | 1.7-beta-2
Keywords: | Resolution: fixed

Has patch: 1 | Triage Stage: Accepted
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Django

unread,
Jun 11, 2014, 11:49:39 AM6/11/14
to django-...@googlegroups.com
#22653: Need to add database features flag in some of the test cases
-------------------------------------+-------------------------------------
Reporter: rahul.priyadarshi@… | Owner: nobody

Type: Uncategorized | Status: closed
Component: Testing framework | Version:
Severity: Normal | 1.7-beta-2
Keywords: | Resolution: fixed
Has patch: 1 | Triage Stage: Accepted
Needs tests: 0 | Needs documentation: 0
Easy pickings: 0 | Patch needs improvement: 0
| UI/UX: 0
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages