mirror of https://github.com/snachodog/mybuddy.git
Update Faker API usage
This commit is contained in:
parent
f4f60363eb
commit
838020ceff
|
@ -8,7 +8,7 @@ from django.db.utils import IntegrityError
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from faker import Factory
|
from faker import Faker
|
||||||
|
|
||||||
from core import models
|
from core import models
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Command, self).__init__(*args, **kwargs)
|
super(Command, self).__init__(*args, **kwargs)
|
||||||
self.faker = Factory.create()
|
self.faker = Faker()
|
||||||
self.child = None
|
self.child = None
|
||||||
self.weight = None
|
self.weight = None
|
||||||
self.tags = []
|
self.tags = []
|
||||||
|
|
|
@ -6,14 +6,14 @@ from django.core.management import call_command
|
||||||
from django.test import Client as HttpClient, override_settings, TestCase
|
from django.test import Client as HttpClient, override_settings, TestCase
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from faker import Factory
|
from faker import Faker
|
||||||
|
|
||||||
|
|
||||||
class FormsTestCase(TestCase):
|
class FormsTestCase(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super(FormsTestCase, cls).setUpClass()
|
super(FormsTestCase, cls).setUpClass()
|
||||||
fake = Factory.create()
|
fake = Faker()
|
||||||
call_command("migrate", verbosity=0)
|
call_command("migrate", verbosity=0)
|
||||||
call_command("fake", verbosity=0)
|
call_command("fake", verbosity=0)
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,14 @@ from django.test import Client as HttpClient
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
|
|
||||||
from faker import Factory
|
from faker import Faker
|
||||||
|
|
||||||
|
|
||||||
class ViewsTestCase(TestCase):
|
class ViewsTestCase(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super(ViewsTestCase, cls).setUpClass()
|
super(ViewsTestCase, cls).setUpClass()
|
||||||
fake = Factory.create()
|
fake = Faker()
|
||||||
call_command("migrate", verbosity=0)
|
call_command("migrate", verbosity=0)
|
||||||
|
|
||||||
cls.c = HttpClient()
|
cls.c = HttpClient()
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from datetime import datetime
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
@ -7,7 +6,7 @@ from django.test import Client as HttpClient
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.utils.formats import get_format
|
from django.utils.formats import get_format
|
||||||
|
|
||||||
from faker import Factory
|
from faker import Faker
|
||||||
|
|
||||||
from core import models
|
from core import models
|
||||||
|
|
||||||
|
@ -20,7 +19,7 @@ class FormsTestCaseBase(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super(FormsTestCaseBase, cls).setUpClass()
|
super(FormsTestCaseBase, cls).setUpClass()
|
||||||
fake = Factory.create()
|
fake = Faker()
|
||||||
call_command("migrate", verbosity=0)
|
call_command("migrate", verbosity=0)
|
||||||
|
|
||||||
cls.c = HttpClient()
|
cls.c = HttpClient()
|
||||||
|
|
|
@ -5,7 +5,7 @@ from django.test import TestCase
|
||||||
from django.test import Client as HttpClient
|
from django.test import Client as HttpClient
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from faker import Factory
|
from faker import Faker
|
||||||
|
|
||||||
from core import models
|
from core import models
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ class ViewsTestCase(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super(ViewsTestCase, cls).setUpClass()
|
super(ViewsTestCase, cls).setUpClass()
|
||||||
fake = Factory.create()
|
fake = Faker()
|
||||||
call_command("migrate", verbosity=0)
|
call_command("migrate", verbosity=0)
|
||||||
call_command("fake", verbosity=0)
|
call_command("fake", verbosity=0)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ from django.test import Client as HttpClient
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
|
|
||||||
from faker import Factory
|
from faker import Faker
|
||||||
|
|
||||||
from core.models import Child
|
from core.models import Child
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class ViewsTestCase(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super(ViewsTestCase, cls).setUpClass()
|
super(ViewsTestCase, cls).setUpClass()
|
||||||
fake = Factory.create()
|
fake = Faker()
|
||||||
call_command("migrate", verbosity=0)
|
call_command("migrate", verbosity=0)
|
||||||
|
|
||||||
cls.c = HttpClient()
|
cls.c = HttpClient()
|
||||||
|
|
|
@ -4,7 +4,7 @@ from django.test import Client as HttpClient
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
|
|
||||||
from faker import Factory
|
from faker import Faker
|
||||||
|
|
||||||
from core import models
|
from core import models
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class ViewsTestCase(TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
super(ViewsTestCase, cls).setUpClass()
|
super(ViewsTestCase, cls).setUpClass()
|
||||||
fake = Factory.create()
|
fake = Faker()
|
||||||
call_command("migrate", verbosity=0)
|
call_command("migrate", verbosity=0)
|
||||||
call_command("fake", verbosity=0)
|
call_command("fake", verbosity=0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue