2017-07-07 14:48:11 +00:00
|
|
|
from django.contrib.gis.geos import GEOSGeometry
|
2016-11-07 22:25:33 +00:00
|
|
|
|
|
|
|
from .classes import BootTestCase
|
|
|
|
from app.models import Task, Project
|
|
|
|
|
|
|
|
class TestApi(BootTestCase):
|
|
|
|
def setUp(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def tearDown(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def test_db(self):
|
2017-07-07 14:48:11 +00:00
|
|
|
# Make sure we can use PostGIS geometry type
|
2016-11-08 14:27:48 +00:00
|
|
|
task = Task.objects.create(project=Project.objects.latest("created_at"),
|
2017-07-07 14:48:11 +00:00
|
|
|
orthophoto_extent=GEOSGeometry("POINT(1 2)"))
|
2016-11-07 22:25:33 +00:00
|
|
|
task.refresh_from_db()
|
2017-07-07 14:48:11 +00:00
|
|
|
self.assertTrue(task.orthophoto_extent is not None)
|