# Path: tests/project/models.py
# class Child(TimeStampedModel):
#     name = models.CharField(max_length=255)
#     parent = models.ForeignKey(Parent, null=True, on_delete=models.CASCADE)
#     objects = Manager.from_queryset(ExtendedQuerySet)()
# 
# class Node(TimeStampedModel):
#     name = models.CharField(max_length=255)
#     parent = models.ForeignKey("self", null=True, on_delete=models.CASCADE)
#     objects = Manager.from_queryset(ExtendedQuerySet)()
# 
# class Parent(TimeStampedModel):
#     name = models.CharField(max_length=255)
#     objects = Manager.from_queryset(ExtendedQuerySet)()
# 
#     @property
#     def attribute_error(self) -> NoReturn:
#         raise AttributeError()
# 
#     @property
#     def version(self) -> str:
#         return str(self.pk) + ":" + str(self.date_modified)
# 
# class SecretModel(models.Model):
#     secret = SecretField()
# 
# class Simple(Model):
#     name = models.CharField(max_length=255)
#     objects = SimpleManager()
# 
# class TestUUIDModel(UUIDModel):
#     text = models.CharField(max_length=255)
#     parent = models.ForeignKey("TestUUIDModel", null=True, on_delete=models.CASCADE)
# 
# class URLSecretModel(models.Model):
#     # num_bytes=25 forces the base64 algorithm to pad
#     secret = URLSecretField(num_bytes=25, min_bytes=25)


from os import environ
from django.conf import global_settings
from django.core.exceptions import ValidationError
from django.test import TestCase
from bananas import environment
from bananas.environment import env
from bananas.models import ModelDict
from tests.project.models import (
    Child,
    Node,
    Parent,
    SecretModel,
    Simple,
    TestUUIDModel,
    URLSecretModel,
)
        from tests.project import settings_example as settings
        self.assertEqual(TestUUIDModel.objects.get(parent__pk=first.pk), second)

    def test_secret_field(self):
        model = SecretModel.objects.create()

        field = SecretModel._meta.get_field("secret")

        field_length = field.get_field_length(field.num_bytes)

        self.assertEqual(len(model.secret), field_length)

        field.auto = False
        self.assertEqual(len(field.pre_save(model, False)), field_length)

        self.assertRaisesMessage(
            ValidationError,
            "SecretField.get_random_bytes returned None",
            field._check_random_bytes,
            None,
        )

        self.assertRaisesMessage(
            ValidationError,
            "Too few random bytes received from get_random_bytes. "
            "Number of bytes=3, min_length=32",
            field._check_random_bytes,
            "123",
        )

    def test_url_secret_field_field_length(self):

# Path: tests/project/models.py
# class Child(TimeStampedModel):
#     name = models.CharField(max_length=255)
#     parent = models.ForeignKey(Parent, null=True, on_delete=models.CASCADE)
#     objects = Manager.from_queryset(ExtendedQuerySet)()
# 
# class Node(TimeStampedModel):
#     name = models.CharField(max_length=255)
#     parent = models.ForeignKey("self", null=True, on_delete=models.CASCADE)
#     objects = Manager.from_queryset(ExtendedQuerySet)()
# 
# class Parent(TimeStampedModel):
#     name = models.CharField(max_length=255)
#     objects = Manager.from_queryset(ExtendedQuerySet)()
# 
#     @property
#     def attribute_error(self) -> NoReturn:
#         raise AttributeError()
# 
#     @property
#     def version(self) -> str:
#         return str(self.pk) + ":" + str(self.date_modified)
# 
# class SecretModel(models.Model):
#     secret = SecretField()
# 
# class Simple(Model):
#     name = models.CharField(max_length=255)
#     objects = SimpleManager()
# 
# class TestUUIDModel(UUIDModel):
#     text = models.CharField(max_length=255)
#     parent = models.ForeignKey("TestUUIDModel", null=True, on_delete=models.CASCADE)
# 
# class URLSecretModel(models.Model):
#     # num_bytes=25 forces the base64 algorithm to pad
#     secret = URLSecretField(num_bytes=25, min_bytes=25)


# Path: tests/tests/tests.py
from os import environ
from django.conf import global_settings
from django.core.exceptions import ValidationError
from django.test import TestCase
from bananas import environment
from bananas.environment import env
from bananas.models import ModelDict
from tests.project.models import (
    Child,
    Node,
    Parent,
    SecretModel,
    Simple,
    TestUUIDModel,
    URLSecretModel,
)
        from tests.project import settings_example as settings

        self.assertEqual(TestUUIDModel.objects.get(parent__pk=first.pk), second)

    def test_secret_field(self):
        model = SecretModel.objects.create()

        field = SecretModel._meta.get_field("secret")

        field_length = field.get_field_length(field.num_bytes)

        self.assertEqual(len(model.secret), field_length)

        field.auto = False
        self.assertEqual(len(field.pre_save(model, False)), field_length)

        self.assertRaisesMessage(
            ValidationError,
            "SecretField.get_random_bytes returned None",
            field._check_random_bytes,
            None,
        )

        self.assertRaisesMessage(
            ValidationError,
            "Too few random bytes received from get_random_bytes. "
            "Number of bytes=3, min_length=32",
            field._check_random_bytes,
            "123",
        )

    def test_url_secret_field_field_length(self):

        model = URLSecretModel.objects.create()