diff --git a/djangoldp/tests/models.py b/djangoldp/tests/models.py index 95dcd8fdd1971f9d8b7c0227d58dd50ff22ac673..899a123272a72ad4c9cd8a6f3e334717d91330e9 100644 --- a/djangoldp/tests/models.py +++ b/djangoldp/tests/models.py @@ -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 diff --git a/djangoldp/tests/tests_update.py b/djangoldp/tests/tests_update.py index 1e3f22d2a92a24e481d593ba46159e209f980608..5ba048c200d8a4822c5ff1c9094172e9319accfe 100644 --- a/djangoldp/tests/tests_update.py +++ b/djangoldp/tests/tests_update.py @@ -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 = [ {