# Path: tests/base.py
# class APITestCase(APITestCase):
#     client_class = APIClient
# 
# Path: tests/rest_app/models.py
# class SlugModel(LabelModel):
#     code = models.SlugField()
#     name = models.CharField(max_length=255)
# 
# class FieldsetModel(LabelModel):
#     # General
#     name = models.CharField(max_length=50)
#     title = models.CharField(max_length=20)
# 
#     # Address
#     address = models.CharField(max_length=255)
#     city = models.CharField(max_length=255)
# 
# Path: tests/gis_app/models.py
# class GeometryModel(LabelModel):
#     name = models.CharField(max_length=255)
#     geometry = models.GeometryField(srid=settings.SRID)


import unittest
import json
from .base import APITestCase
from rest_framework import status
from tests.rest_app.models import SlugModel, FieldsetModel
from tests.gis_app.models import GeometryModel
from django.contrib.auth.models import User
from django.conf import settings


class RestPostTestCase(APITestCase):
    def setUp(self):
        self.user = User.objects.create(username="testuser", is_superuser=True)
        self.client.force_authenticate(self.user)

    @unittest.skipUnless(settings.WITH_GIS, "requires GIS")

# Path: tests/base.py
# class APITestCase(APITestCase):
#     client_class = APIClient
# 
# Path: tests/rest_app/models.py
# class SlugModel(LabelModel):
#     code = models.SlugField()
#     name = models.CharField(max_length=255)
# 
# class FieldsetModel(LabelModel):
#     # General
#     name = models.CharField(max_length=50)
#     title = models.CharField(max_length=20)
# 
#     # Address
#     address = models.CharField(max_length=255)
#     city = models.CharField(max_length=255)
# 
# Path: tests/gis_app/models.py
# class GeometryModel(LabelModel):
#     name = models.CharField(max_length=255)
#     geometry = models.GeometryField(srid=settings.SRID)


# Path: tests/test_post.py
import unittest
import json
from .base import APITestCase
from rest_framework import status
from tests.rest_app.models import SlugModel, FieldsetModel
from tests.gis_app.models import GeometryModel
from django.contrib.auth.models import User
from django.conf import settings



class RestPostTestCase(APITestCase):
    def setUp(self):
        self.user = User.objects.create(username="testuser", is_superuser=True)
        self.client.force_authenticate(self.user)

    @unittest.skipUnless(settings.WITH_GIS, "requires GIS")

    def test_rest_geometry_post_geojson(self):