mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-14 16:47:02 +02:00
Refactor fixtures from JSON to Python
This commit is contained in:
parent
ba7c0b9e8d
commit
df265b10f8
10 changed files with 426 additions and 270 deletions
18
src/registrar/management/commands/load.py
Normal file
18
src/registrar/management/commands/load.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import logging
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from auditlog.context import disable_auditlog # type: ignore
|
||||
|
||||
from registrar.fixtures import UserFixture, DomainApplicationFixture
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def handle(self, *args, **options):
|
||||
# django-auditlog has some bugs with fixtures
|
||||
# https://github.com/jazzband/django-auditlog/issues/17
|
||||
with disable_auditlog():
|
||||
UserFixture.load()
|
||||
DomainApplicationFixture.load()
|
||||
logger.info("All fixtures loaded.")
|
Loading…
Add table
Add a link
Reference in a new issue