-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Add tests for M2M relations with inheritance and a through model #3918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This particular setup worked fine up to DRF 3.2.5, but is broken in DRF 3.3.0. Bisecting indicates that 322bda8 first introduced the regression. This commit adds a few testcases that pass with DRF 3.2.5 but fail with DRF 3.3.0 and newer.
Note that the CI checks have failed for this PR. This is perfectly normal, since the new tests exercise a regression :) |
Thanks! |
Could you also outline the simplest possible example case, what you would expect the behavior to be, and what the behavior currently is? |
The simplest possible example case is unfortunately not so simple, it's the one in the new tests introduced by this PR. Basically:
The expected behaviour is that DRF is able to serialize the objects (for all three models). The current behaviour (starting with 322bda8) is that DRF throws an exception when serializing:
See https://travis-ci.org/tomchristie/django-rest-framework/jobs/108339903 for an example of failure. |
Blimey - that's a pretty obscure use-case corner you've found there. |
Bump? I still get the same error with DRF 3.3.3 and Django 1.9.7. As a reminder, I had bisected the issue to this commit: 322bda8 |
Still not high enough priority just now, given edge-case-ness. Focus is on 3.4.0 first. |
I'm going to de-milestone for now. We can reassess after v3.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to know, if this change is still needed with django 2.0+ versions and latest drf versions? hope you would take the time to consider verifying the validity of proposed change with newer releases.
I'm just going to close this off as stale at this point - can reassess if it gets bumped sometime. |
This particular setup worked fine up to DRF 3.2.5, but is broken in DRF
3.3.0. Bisecting indicates that 322bda8
first introduced the regression.
This commit adds a few testcases that pass with DRF 3.2.5 but fail with
DRF 3.3.0 and newer.