def METHOD_NAME(self):
    """
    Test whether custom validate_previous_plugin_inst method validates that an integer
    id is provided for previous instance. Then checks that the id exists in the DB and
    that the user can run plugins within the corresponding feed.
    """
    owner = User.objects.get(username=self.username)
    plugin = Plugin.objects.get(meta__name=self.plugin_fs_name)
    (pl_inst, tf) = PluginInstance.objects.get_or_create(
        plugin=plugin, owner=owner, compute_resource=plugin.compute_resources.all()[0])
    data = {'title': 'PipelineInst1', 'previous_plugin_inst_id': pl_inst.id}
    pipeline_inst_serializer = PipelineInstanceSerializer(data=data)
    pipeline_inst_serializer.context['request'] = mock.Mock()
    pipeline_inst_serializer.context['request'].user = owner
    with self.assertRaises(serializers.ValidationError):
        pipeline_inst_serializer.validate_previous_plugin_inst(None)
    with self.assertRaises(serializers.ValidationError):
        pipeline_inst_serializer.validate_previous_plugin_inst(pl_inst.id+1)
    # create another user
    another_user = User.objects.create_user(username='boo', password='far')
    with self.assertRaises(serializers.ValidationError):
        pipeline_inst_serializer.context['request'].user = another_user
        pipeline_inst_serializer.validate_previous_plugin_inst(pl_inst.id)