# Path: tests/admin.py
# class RecordAdmin(admin.ModelAdmin):
#     pass
# 
# Path: tests/models.py
# class Record(models.Model):
#     id = BigHashidAutoField(primary_key=True)
#     name = models.CharField(max_length=40)
#     artist = models.ForeignKey(Artist, on_delete=models.CASCADE, null=True, blank=True, related_name="records")
#     reference_id = HashidField()
#     prefixed_id = HashidField(null=True, blank=True, prefix="prefix_")
#     string_id = HashidField(null=True, blank=True, enable_hashid_object=False)
#     plain_hashid = HashidField(null=True, blank=True, enable_descriptor=False)
#     plain_id = HashidField(null=True, blank=True, enable_descriptor=False, enable_hashid_object=False)
#     alternate_id = HashidField(salt="a different salt", null=True, blank=True)
#     key = BigHashidField(min_length=10, alphabet="abcdlmnotuvwxyz123789", null=True, blank=True)
# 
#     def __str__(self):
#         return "{} ({})".format(self.name, self.reference_id)


from django.contrib.admin import AdminSite
from django.test import TestCase
from tests.admin import RecordAdmin
from tests.models import Record



class MockRequest:
    pass


class MockSuperUser:
    def has_perm(self, perm):
        return True


site = AdminSite()
request = MockRequest()
request.user = MockSuperUser()


class HashidAdminTests(TestCase):
    def test_admin_widget_is_text(self):

# Path: tests/admin.py
# class RecordAdmin(admin.ModelAdmin):
#     pass
# 
# Path: tests/models.py
# class Record(models.Model):
#     id = BigHashidAutoField(primary_key=True)
#     name = models.CharField(max_length=40)
#     artist = models.ForeignKey(Artist, on_delete=models.CASCADE, null=True, blank=True, related_name="records")
#     reference_id = HashidField()
#     prefixed_id = HashidField(null=True, blank=True, prefix="prefix_")
#     string_id = HashidField(null=True, blank=True, enable_hashid_object=False)
#     plain_hashid = HashidField(null=True, blank=True, enable_descriptor=False)
#     plain_id = HashidField(null=True, blank=True, enable_descriptor=False, enable_hashid_object=False)
#     alternate_id = HashidField(salt="a different salt", null=True, blank=True)
#     key = BigHashidField(min_length=10, alphabet="abcdlmnotuvwxyz123789", null=True, blank=True)
# 
#     def __str__(self):
#         return "{} ({})".format(self.name, self.reference_id)


# Path: tests/test_admin.py
from django.contrib.admin import AdminSite
from django.test import TestCase
from tests.admin import RecordAdmin
from tests.models import Record




class MockRequest:
    pass


class MockSuperUser:
    def has_perm(self, perm):
        return True


site = AdminSite()
request = MockRequest()
request.user = MockSuperUser()


class HashidAdminTests(TestCase):
    def test_admin_widget_is_text(self):

        admin = RecordAdmin(Record, site)