diff --git a/djangoldp/tests/tests_save.py b/djangoldp/tests/tests_save.py index c4ca139960d27350215870d93612e0e04f2ff782..9ee478fc06c8f7ee1f6bc419571a5964c5e7237e 100644 --- a/djangoldp/tests/tests_save.py +++ b/djangoldp/tests/tests_save.py @@ -237,3 +237,34 @@ class Save(TestCase): content_type='application/ld+json') self.assertEqual(response.status_code, 201) self.assertIn('userprofile', response.data) + + def test_embedded_context(self): + body = { + '@graph': [ + { + '@id': "./", + 'content': "post update", + 'peer_user': "" + } + ], + '@context': { + "@vocab": "http://happy-dev.fr/owl/#", + } + } + response = self.client.post('/posts/', data=json.dumps(body), + content_type='application/ld+json') + self.assertEqual(response.status_code, 201) + + def test_embedded_context_2(self): + body = { + '@id': "./", + 'content': "post update", + 'peer_user': "", + '@context': { + "@vocab": "http://happy-dev.fr/owl/#", + } + } + + response = self.client.post('/posts/', data=json.dumps(body), + content_type='application/ld+json') + self.assertEqual(response.status_code, 201)