# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from treemap.lib.udf import udf_create
from treemap.tests.test_udfs import UdfCRUTestCase


class UdfGenericCreateTest(UdfCRUTestCase):
    def test_non_treemap_model(self):
        self.instance.map_feature_types += ['Bioswale']
        self.instance.save()

        body = {'udf.name': 'Testing choice',
                'udf.model': 'Bioswale',
                'udf.type': 'string'}

        udf_create(body, self.instance)

# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from treemap.lib.udf import udf_create
from treemap.tests.test_udfs import UdfCRUTestCase


class UdfGenericCreateTest(UdfCRUTestCase):
    def test_non_treemap_model(self):
        self.instance.map_feature_types += ['Bioswale']
        self.instance.save()

        body = {'udf.name': 'Testing choice',
                'udf.model': 'Bioswale',
                'udf.type': 'string'}

        udf_create(body, self.instance)

        # teardown, for the sake of other tests that look at map_feature_types
        self.instance.map_feature_types = [
            t for t in self.instance.map_feature_types if t != 'Bioswale']
        self.instance.save()

Add cleanup to fix tests