'The emptystring should be interpreted as null in the context
of relationships.'

def test_foreign_key_create_with_valid_emptystring(self):

    data = {'id': 4, 'name': 'source-4', 'target': ''}
    expected_data = {'id': 4, 'name': 'source-4', 'target': None}
    serializer = NullableForeignKeySourceSerializer(data=data)
    assert serializer.is_valid()
    obj = serializer.save()
    assert (serializer.data == expected_data)
    assert (obj.name == 'source-4')
    queryset = NullableForeignKeySource.objects.all()
    serializer = NullableForeignKeySourceSerializer(queryset, many=True)
    expected = [{'id': 1, 'name': 'source-1', 'target': 'target-1'}, {'id': 2, 'name': 'source-2', 'target': 'target-1'}, {'id': 3, 'name': 'source-3', 'target': None}, {'id': 4, 'name': 'source-4', 'target': None}]
    assert (serializer.data == expected)
