{"id":20637001,"url":"https://github.com/chairchandler/django-fields-testing","last_synced_at":"2026-05-16T00:34:56.187Z","repository":{"id":258844968,"uuid":"875787619","full_name":"ChairChandler/django-fields-testing","owner":"ChairChandler","description":"Package for testing fields in django models and regular classes.","archived":false,"fork":false,"pushed_at":"2024-10-21T16:16:43.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-17T08:12:50.610Z","etag":null,"topics":["django","django-models","model-testing","orm-library","pytest","testing","testing-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChairChandler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-20T20:31:15.000Z","updated_at":"2024-10-21T16:17:26.000Z","dependencies_parsed_at":"2024-10-22T01:32:30.784Z","dependency_job_id":null,"html_url":"https://github.com/ChairChandler/django-fields-testing","commit_stats":null,"previous_names":["chairchandler/django-fields-testing"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChairChandler%2Fdjango-fields-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChairChandler%2Fdjango-fields-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChairChandler%2Fdjango-fields-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChairChandler%2Fdjango-fields-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChairChandler","download_url":"https://codeload.github.com/ChairChandler/django-fields-testing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242656036,"owners_count":20164431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-models","model-testing","orm-library","pytest","testing","testing-library"],"created_at":"2024-11-16T15:12:43.184Z","updated_at":"2026-05-16T00:34:51.125Z","avatar_url":"https://github.com/ChairChandler.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\n## Overview\n\nPackage allows to test django model fields, meta model fields and normal class fields by subclasing dedicated special classes and django test class.\nEvery single class created using subclassing API is dedicated to specified model field. Apart from basic\nfield information like name and type for specified model, we can also test if it was created with specified attributes. Attributes are predefined.\n\nExample:\n\n```python\nfrom django.test import SimpleTestCase\n\nclass NameFieldTest(ModelFieldTest, SimpleTestCase):\n    model = User\n    field_name = 'name'\n    field_type = TextField\n    default = ''\n    primary_key = True\n\nclass UppercasedUsernameFieldTest(ClassFieldTest, SimpleTestCase):\n    klass = User\n    field_name = 'USERNAME_FIELD'\n    value = 'email'\n\nclass ConstraintsFieldTest(MetaFieldTest, SimpleTestCase):\n    klass = User\n    field_name = 'constraints'\n    value = [\n        models.UniqueConstraint(\n            fields=['telephone_prefix', 'telephone_number'],\n            name='telephone_number_with_prefix_unique'\n        )\n    ]\n```\n\nModel field tests currently support the following attributes for fields:\n\n- primary_key\n- default\n- verbose_name\n- unique\n- max_length\n- validators\n- help_text\n- null\n- blank\n\n## Source code\n\n**src** directory contains files dedicated to one of the special field testing class.\n\n## Testing\n\n**tests** directory contains files dedicated to testing one of the special field testing class.\n\nTo run tests, run script **run_tests.sh** inside **scripts** directory. It will generates unit tests report and coverage report inside **reports** directory.\n\n## Building\n\nTo build a package run **run_build.sh** inside **scripts** directory. It will generate **whl** package file inside **dist** directory.\n\n## Installation\n\nBeing inside package base directory run\n\u003e pip install dist/\u003cred\u003e\u003cpackage_name\u003e\u003c/red\u003e.whl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchairchandler%2Fdjango-fields-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchairchandler%2Fdjango-fields-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchairchandler%2Fdjango-fields-testing/lists"}