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

def test_foreign_key_create_with_valid_emptystring(self):

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