Closed dfrankow closed 5 years ago
OK I had a really weird issue... a loop used the variable name
, but the loop had the string "name" hard coded which must have (coincidentally) been the unique in my internal usage. Fixed in master. Looking into your second test case.
The second test still fails, but due to an erroneous assertion. You're using GetOrCreate
on the AccessSerializer
. Both are requesting the same key
so both get it. I assume you really want a CreateOnlyNestedSerializer
for that case.
I went ahead and added a CreateOnlyNestedSerializerMixin
in master. I dropped it into your example and get a different (but expected) error because the two requests use the same key
. This causes a unique key collision.
... just to make sure the code was working, when I also drop the unique
constraint on AccessKey.key
, the test passes.
Yep, I think this one is fixed.
Run the unit tests of https://github.com/dfrankow/drf-writable-example/commit/2832ce8df6427cb6b94682d12243bccb39047b2e
I think the problem is
unique=True
on User.username.I attach the error.
error.txt