# Path: assessment/models.py
# class Survey(TranslatableModel):
#     _uid = models.UUIDField(
#         primary_key=True,
#         editable=False,
#         default=uuid.uuid4,
#     )
# 
#     translations = TranslatedFields(
#         name=models.CharField(_("name"), max_length=160),
#         description=models.TextField(_("description")),
#     )
# 
#     is_active = models.BooleanField(
#         _("active"),
#         default=True,
#     )
# 
#     is_private = models.BooleanField(
#         _("private"),
#         default=False,
#     )
# 
#     start_date_time = models.DateTimeField(
#         _("start time"),
#         auto_now=False,
#         default=datetime.datetime.now,
#     )
# 
#     end_date_time = models.DateTimeField(
#         _("end time"),
#         auto_now=False,
#         null=True,
#         blank=True,
#     )
# 
#     admin = models.ForeignKey(
#         settings.AUTH_USER_MODEL,
#         on_delete=models.SET_NULL,
#         null=True,
#         related_name="assessment_admin_surveys",
#         verbose_name=_('owner'),
#     )
# 
#     users = models.ManyToManyField(
#         settings.AUTH_USER_MODEL,
#         related_name="assessment_user_surveys",
#         blank=True,
#     )
# 
#     class Meta:
#         app_label = 'assessment'
#         verbose_name = _("survey")
#         verbose_name_plural = _("surveys")
# 
#     def __str__(self):
#         return self.name


import datetime
    from django.contrib.auth import get_user_model
    from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from assessment.models import Survey

    def test_create_private_survey(self):
        """
        Ensure we can create a new survey object.
        """
        url = reverse('assessment-api:create_survey')
        data = {
            "translations": {
                "de": {
                    "name": "Hallo Welt",
                    "slug": "hallo-welt",
                    "description": "Wie sage ich; 'Hello World', auf Deutsch?",
                },
                "en": {
                    "name": "Hello World",
                    "slug": "hello-world",
                    "description": "How do I say; 'Hello world', in English?",
                },
                "nl": {
                    "name": "Hallo Wereld",
                    "slug": "hallo-wereld",
                    "description": "Hoe zeg ik; 'Hello World', in Nederlandse?",
                }
            },
            "is_private": True,
            "is_active": True,
            "start_date_time": datetime.datetime.now(),
        }
        response = self.client.post(url, data, format='json')
        self.assertEqual(response.status_code, status.HTTP_201_CREATED)

# Path: assessment/models.py
# class Survey(TranslatableModel):
#     _uid = models.UUIDField(
#         primary_key=True,
#         editable=False,
#         default=uuid.uuid4,
#     )
# 
#     translations = TranslatedFields(
#         name=models.CharField(_("name"), max_length=160),
#         description=models.TextField(_("description")),
#     )
# 
#     is_active = models.BooleanField(
#         _("active"),
#         default=True,
#     )
# 
#     is_private = models.BooleanField(
#         _("private"),
#         default=False,
#     )
# 
#     start_date_time = models.DateTimeField(
#         _("start time"),
#         auto_now=False,
#         default=datetime.datetime.now,
#     )
# 
#     end_date_time = models.DateTimeField(
#         _("end time"),
#         auto_now=False,
#         null=True,
#         blank=True,
#     )
# 
#     admin = models.ForeignKey(
#         settings.AUTH_USER_MODEL,
#         on_delete=models.SET_NULL,
#         null=True,
#         related_name="assessment_admin_surveys",
#         verbose_name=_('owner'),
#     )
# 
#     users = models.ManyToManyField(
#         settings.AUTH_USER_MODEL,
#         related_name="assessment_user_surveys",
#         blank=True,
#     )
# 
#     class Meta:
#         app_label = 'assessment'
#         verbose_name = _("survey")
#         verbose_name_plural = _("surveys")
# 
#     def __str__(self):
#         return self.name


# Path: assessment/tests/test_survey.py
import datetime
    from django.contrib.auth import get_user_model
    from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from assessment.models import Survey


    def test_create_private_survey(self):
        """
        Ensure we can create a new survey object.
        """
        url = reverse('assessment-api:create_survey')
        data = {
            "translations": {
                "de": {
                    "name": "Hallo Welt",
                    "slug": "hallo-welt",
                    "description": "Wie sage ich; 'Hello World', auf Deutsch?",
                },
                "en": {
                    "name": "Hello World",
                    "slug": "hello-world",
                    "description": "How do I say; 'Hello world', in English?",
                },
                "nl": {
                    "name": "Hallo Wereld",
                    "slug": "hallo-wereld",
                    "description": "Hoe zeg ik; 'Hello World', in Nederlandse?",
                }
            },
            "is_private": True,
            "is_active": True,
            "start_date_time": datetime.datetime.now(),
        }
        response = self.client.post(url, data, format='json')
        self.assertEqual(response.status_code, status.HTTP_201_CREATED)

        self.assertEqual(Survey.objects.get().name, 'Hello World')