#35712: CheckConstraint with RawSQL breaks ModelForm when inside
transaction.atomic()
-------------------------------------+-------------------------------------
Reporter: a-p-f | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 5.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
> I gave a quick stab at writing a PR, but I'm not familiar enough with
Django's test suite.
I suggest your refer to
[https://docs.djangoproject.com/en/5.1/internals/contributing/writing-code
/unit-tests/ this part of the documentation] which covers the basics. In
this ticket's case you'll want to adjust
[https://github.com/django/django/blob/2b71b2c8dcd40f2604310bb3914077320035b399/tests/queries/test_q.py#L317-L329
this test] to ensure that the connection is still usable after `q.check`
is called.
> This issue does not occur when using sqlite, and I'm not sure how to run
any of the tests from Django's test suite using postgres as the database
engine.
In order to test against Postgres, which is where the issues manifests
itself, I suggest you have a look at
[https://docs.djangoproject.com/en/5.1/internals/contributing/writing-code
/unit-tests/#running-tests-using-django-docker-box django-docker-box] if
you have Docker installed locally. Once checked out you should simply have
to point it at your local django/django checkout to run your adjusted
tests against Postgres.
> I'm happy to keep working on this if someone wants to point me in the
right direction, but it's such a small patch/test that it's probably
easier for someone else to handle it.
I think it's the perfect opportunity to contribute back a code change
given the scope of the ticket and we're happy to support you through it.
If you're willing to do so you should start by assigning this ticket to
yourself in the ''Mofify Ticket'' section of this tracker.
--
Ticket URL: <https://code.djangoproject.com/ticket/35712#comment:3>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107019195af2b5a-a65deb3f-c240-4216-a2b1-05388b467dfc-000000%40eu-central-1.amazonses.com.