From 6d6b1cd9c405c54cc78dc2b7cbe217ba526a9829 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Mon, 20 Jan 2020 20:55:17 +0000 Subject: partial way through playing with Faker --- ctrack/conftest.py | 8 +++++++- ctrack/organisations/tests/test_models.py | 5 +---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ctrack/conftest.py b/ctrack/conftest.py index 2efd243..d9755f7 100644 --- a/ctrack/conftest.py +++ b/ctrack/conftest.py @@ -3,7 +3,11 @@ from django.test import RequestFactory from ctrack.users.models import User from ctrack.organisations.models import Organisation, Address -from ctrack.users.tests.factories import UserFactory, OrganisationFactory, AddressFactory +from ctrack.users.tests.factories import ( + UserFactory, + OrganisationFactory, + AddressFactory, +) @pytest.fixture(autouse=True) @@ -20,10 +24,12 @@ def user() -> User: def org() -> Organisation: return OrganisationFactory() + @pytest.fixture def addr() -> Address: return AddressFactory() + @pytest.fixture def request_factory() -> RequestFactory: return RequestFactory() diff --git a/ctrack/organisations/tests/test_models.py b/ctrack/organisations/tests/test_models.py index f642c11..b178508 100644 --- a/ctrack/organisations/tests/test_models.py +++ b/ctrack/organisations/tests/test_models.py @@ -12,8 +12,5 @@ def test_organisation_get_absolute_url(org: Organisation): def test_create_organisation(addr: Address): - Organisation( - name="Big Bad OES Corporation", - address = addr - ).save() + Organisation(name="Big Bad OES Corporation", address=addr).save() assert Organisation.objects.get(name="Big Bad OES Corporation") -- cgit v1.2.3