# Path: spillway/urls.py
# def tilepath(regex):
# def is_tilepath(path):
# 
# Path: spillway/views.py
# class RasterTileView(mixins.ResponseExceptionMixin, GenericAPIView):
# class TileView(mixins.ResponseExceptionMixin, BaseGeoView, ListAPIView):
#     def get(self, request, *args, **kwargs):
#     def get(self, request, *args, **kwargs):
# 
# Path: spillway/compat.py
# class JSONEncoder(json.JSONEncoder):
# class Mapnik(object):
#     def __getattr__(self, attr):
# 
# Path: tests/models.py
# class Location(AbstractLocation):
#     """Test location."""
#     objects = GeoQuerySet.as_manager()
# 
# Path: tests/test_models.py
# class RasterStoreTestBase(RasterTestBase, TestCase):
#     def setUp(self):
#         super(RasterStoreTestBase, self).setUp()
#         self.object = RasterStore.objects.create(image=self.data['image'].name)
#         self.qs = RasterStore.objects.all()


from io import BytesIO
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.contrib.gis import geos
from rest_framework.test import APIRequestFactory, APITestCase
from PIL import Image
from spillway import urls, views
from spillway.compat import mapnik
from .models import Location
from .test_models import RasterStoreTestBase
import unittest



try:
    has_mapnik = bool(mapnik.Map)
except ImproperlyConfigured:
    has_mapnik = False


class TileViewTestCase(APITestCase):
    def setUp(self):
        self.geometry = {'type': 'Polygon',
                         'coordinates': [[ [14.14, 50.21],
                                           [14.89, 50.20],
                                           [14.39, 49.76],
                                           [14.14, 50.21] ]]}
        Location.create(name='Prague', geom=self.geometry)

# Path: spillway/urls.py
# def tilepath(regex):
# def is_tilepath(path):
# 
# Path: spillway/views.py
# class RasterTileView(mixins.ResponseExceptionMixin, GenericAPIView):
# class TileView(mixins.ResponseExceptionMixin, BaseGeoView, ListAPIView):
#     def get(self, request, *args, **kwargs):
#     def get(self, request, *args, **kwargs):
# 
# Path: spillway/compat.py
# class JSONEncoder(json.JSONEncoder):
# class Mapnik(object):
#     def __getattr__(self, attr):
# 
# Path: tests/models.py
# class Location(AbstractLocation):
#     """Test location."""
#     objects = GeoQuerySet.as_manager()
# 
# Path: tests/test_models.py
# class RasterStoreTestBase(RasterTestBase, TestCase):
#     def setUp(self):
#         super(RasterStoreTestBase, self).setUp()
#         self.object = RasterStore.objects.create(image=self.data['image'].name)
#         self.qs = RasterStore.objects.all()


# Path: tests/test_views.py
from io import BytesIO
from django.core.exceptions import ImproperlyConfigured
from django.core.files import File
from django.contrib.gis import geos
from rest_framework.test import APIRequestFactory, APITestCase
from PIL import Image
from spillway import urls, views
from spillway.compat import mapnik
from .models import Location
from .test_models import RasterStoreTestBase
import unittest




try:
    has_mapnik = bool(mapnik.Map)
except ImproperlyConfigured:
    has_mapnik = False


class TileViewTestCase(APITestCase):
    def setUp(self):
        self.geometry = {'type': 'Polygon',
                         'coordinates': [[ [14.14, 50.21],
                                           [14.89, 50.20],
                                           [14.39, 49.76],
                                           [14.14, 50.21] ]]}
        Location.create(name='Prague', geom=self.geometry)

        self.g = Location.objects.first().geom