'Test a relationship that spans a GenericForeignKey field.
IE. A forward generic relationship.'

def test_generic_fk(self):

    class TagSerializer(serializers.ModelSerializer, ):
        tagged_item = serializers.StringRelatedField()
        class Meta:
            model = Tag
            fields = (u'tag', u'tagged_item')
    serializer = TagSerializer(Tag.objects.all(), many=True)
    expected = [{u'tag': u'django', u'tagged_item': u'Bookmark:    https://www.djangoproject.com/'}, {u'tag': u'python', u'tagged_item': u'Bookmark:    https://www.djangoproject.com/'}, {u'tag': u'reminder', u'tagged_item': u'Note:    Remember    the    milk'}]
    assert (serializer.data == expected)
