@@ -0,0 +1,1703 @@
+import json%0A%0Afrom rest_framework import serializers%0Afrom rest_framework.renderers import JSONRenderer%0A%0Afrom django.test.client import RequestFactory%0A%0Afrom editorsnotes.auth.models import Project%0A%0Afrom .views import ClearContentTypesTransactionTestCase%0Afrom ..serializers.base import EmbeddedItemsMixin%0Afrom ..serializers import ProjectSerializer%0A%0A%0Aclass EmbeddingSerializerTestCase(ClearContentTypesTransactionTestCase):%0A    fixtures = %5B'projects.json'%5D%0A%0A    def setUp(self):%0A        factory = RequestFactory()%0A        self.dummy_request = factory.get('/')%0A%0A    def test_has_embedded_project(self):%0A        context = %7B'request': self.dummy_request%7D%0A%0A        project = Project.objects.get(slug='emma')%0A        project_url = self.dummy_request.build_absolute_uri(%0A            project.get_absolute_url())%0A        project_serializer = ProjectSerializer(%0A            instance=project, context=context)%0A%0A        class SimpleEmbeddingSerializer(EmbeddedItemsMixin,%0A                                        serializers.Serializer):%0A            project_url = serializers.SerializerMethodField()%0A%0A            class Meta:%0A                fields = ('project_url',)%0A                embedded_fields = ('project_url',)%0A%0A            def get_project_url(self, obj):%0A                return project_url%0A%0A        test_serializer = SimpleEmbeddingSerializer(%7B%7D,%0A            include_embeds=True,%0A            context=context%0A        )%0A%0A        data = json.loads(JSONRenderer().render(test_serializer.data))%0A        project_data = json.loads(JSONRenderer().render(project_serializer.data))%0A%0A        self.assertEqual(data, %7B%0A            'project_url': project_url,%0A            '_embedded': %7Bproject_url: project_data%7D%0A        %7D)%0A

Add a test for embedding Project URLs in serializers