Update Faker API usage

This commit is contained in:
Christopher C. Wells 2022-05-27 19:56:38 -07:00 committed by Christopher Charbonneau Wells
parent f4f60363eb
commit 838020ceff
7 changed files with 14 additions and 15 deletions

View File

@ -8,7 +8,7 @@ from django.db.utils import IntegrityError
from django.core.management.base import BaseCommand
from django.utils import timezone
from faker import Factory
from faker import Faker
from core import models
@ -18,7 +18,7 @@ class Command(BaseCommand):
def __init__(self, *args, **kwargs):
super(Command, self).__init__(*args, **kwargs)
self.faker = Factory.create()
self.faker = Faker()
self.child = None
self.weight = None
self.tags = []

View File

@ -6,14 +6,14 @@ from django.core.management import call_command
from django.test import Client as HttpClient, override_settings, TestCase
from django.utils import timezone
from faker import Factory
from faker import Faker
class FormsTestCase(TestCase):
@classmethod
def setUpClass(cls):
super(FormsTestCase, cls).setUpClass()
fake = Factory.create()
fake = Faker()
call_command("migrate", verbosity=0)
call_command("fake", verbosity=0)

View File

@ -6,14 +6,14 @@ from django.test import Client as HttpClient
from django.contrib.auth.models import User
from django.core.management import call_command
from faker import Factory
from faker import Faker
class ViewsTestCase(TestCase):
@classmethod
def setUpClass(cls):
super(ViewsTestCase, cls).setUpClass()
fake = Factory.create()
fake = Faker()
call_command("migrate", verbosity=0)
cls.c = HttpClient()

View File

@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from datetime import datetime
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test import TestCase
@ -7,7 +6,7 @@ from django.test import Client as HttpClient
from django.utils import timezone
from django.utils.formats import get_format
from faker import Factory
from faker import Faker
from core import models
@ -20,7 +19,7 @@ class FormsTestCaseBase(TestCase):
@classmethod
def setUpClass(cls):
super(FormsTestCaseBase, cls).setUpClass()
fake = Factory.create()
fake = Faker()
call_command("migrate", verbosity=0)
cls.c = HttpClient()

View File

@ -5,7 +5,7 @@ from django.test import TestCase
from django.test import Client as HttpClient
from django.utils import timezone
from faker import Factory
from faker import Faker
from core import models
@ -14,7 +14,7 @@ class ViewsTestCase(TestCase):
@classmethod
def setUpClass(cls):
super(ViewsTestCase, cls).setUpClass()
fake = Factory.create()
fake = Faker()
call_command("migrate", verbosity=0)
call_command("fake", verbosity=0)

View File

@ -4,7 +4,7 @@ from django.test import Client as HttpClient
from django.contrib.auth.models import User
from django.core.management import call_command
from faker import Factory
from faker import Faker
from core.models import Child
@ -13,7 +13,7 @@ class ViewsTestCase(TestCase):
@classmethod
def setUpClass(cls):
super(ViewsTestCase, cls).setUpClass()
fake = Factory.create()
fake = Faker()
call_command("migrate", verbosity=0)
cls.c = HttpClient()

View File

@ -4,7 +4,7 @@ from django.test import Client as HttpClient
from django.contrib.auth.models import User
from django.core.management import call_command
from faker import Factory
from faker import Faker
from core import models
@ -13,7 +13,7 @@ class ViewsTestCase(TestCase):
@classmethod
def setUpClass(cls):
super(ViewsTestCase, cls).setUpClass()
fake = Factory.create()
fake = Faker()
call_command("migrate", verbosity=0)
call_command("fake", verbosity=0)