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

def test_foreign_key_update_with_valid_emptystring(self):

    data = {u'url': u'http://testserver/nullableforeignkeysource/1/', u'name': u'source-1', u'target': u''}
    expected_data = {u'url': u'http://testserver/nullableforeignkeysource/1/', u'name': u'source-1', u'target': None}
    instance = NullableForeignKeySource.objects.get(pk=1)
    serializer = NullableForeignKeySourceSerializer(instance, data=data, context={u'request': request})
    assert serializer.is_valid()
    serializer.save()
    assert (serializer.data == expected_data)
    queryset = NullableForeignKeySource.objects.all()
    serializer = NullableForeignKeySourceSerializer(queryset, many=True, context={u'request': request})
    expected = [{u'url': u'http://testserver/nullableforeignkeysource/1/', u'name': u'source-1', u'target': None}, {u'url': u'http://testserver/nullableforeignkeysource/2/', u'name': u'source-2', u'target': u'http://testserver/foreignkeytarget/1/'}, {u'url': u'http://testserver/nullableforeignkeysource/3/', u'name': u'source-3', u'target': None}]
    assert (serializer.data == expected)
