from django.test import TestCase

from smoothglue.core.tests.utils import CommonSerializer
from smoothglue.map.models import ImageryLayer
from smoothglue.map.serializers.imagery_layer import ImageryLayerSerializer


class TestImageryLayerJsonSerializer(TestCase):
    def setUp(self):
        self.image_layer_data = {
            "name": "test",
            "url": "http://braingu.com",
            "provider_type": "ArcGisMapServerImageryProvider",
        }

        self.required_fields = []

    def test_serializer_valid(self):
        CommonSerializer(serializer=ImageryLayerSerializer).test_model_serializer_valid(
            model=ImageryLayer,
            required_fields=self.required_fields,
            data=self.image_layer_data,
        )
