Skip to content
Snippets Groups Projects
Commit 5119dc2f authored by Jean-Baptiste's avatar Jean-Baptiste
Browse files

comment: nested update can't work when depth=0

parent 204a5760
No related branches found
Tags v0.5.86
No related merge requests found
Pipeline #955 passed
......@@ -36,6 +36,9 @@ class UserProfile(Model):
description = models.CharField(max_length=255, blank=True, null=True)
user = models.OneToOneField(settings.AUTH_USER_MODEL)
class Meta:
depth = 1
class Message(models.Model):
text = models.CharField(max_length=255, blank=True, null=True)
......@@ -86,4 +89,4 @@ class Post(Model):
auto_author = 'author'
get_user_model()._meta.serializer_fields = ['@id', 'username', 'first_name', 'last_name', 'email', 'userprofile']
get_user_model()._meta.serializer_fields = ['@id', 'username', 'first_name', 'last_name', 'email', 'userprofile']
\ No newline at end of file
......@@ -272,7 +272,11 @@ class Update(TestCase):
self.assertEquals(response.data['content'], "post content")
self.assertIn('location', response._headers)
def test_create_sub_object_in_existing_object_with_reverse_relation(self):
"""
Doesn't work with depth = 0 on UserProfile Model. Should it be ?
"""
user = User.objects.create(username="alex", password="test")
body = [
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment