diff --git a/jobs/settings/testing.py b/jobs/settings/testing.py index 0b2e714f..27aa71a6 100644 --- a/jobs/settings/testing.py +++ b/jobs/settings/testing.py @@ -1 +1 @@ -from . import * #noqa +from . import * # noqa diff --git a/jobsapp/views/employer.py b/jobsapp/views/employer.py index 67a560b6..625ad47f 100644 --- a/jobsapp/views/employer.py +++ b/jobsapp/views/employer.py @@ -4,6 +4,7 @@ from django.urls import reverse_lazy from django.utils.decorators import method_decorator from django.views.generic import CreateView, DeleteView, ListView + from jobsapp.decorators import user_is_employer from jobsapp.forms import CreateJobForm from jobsapp.models import Applicant, Job diff --git a/tests/accounts/test_accounts.py b/tests/accounts/test_accounts.py index d66e1d10..9a5a0a48 100644 --- a/tests/accounts/test_accounts.py +++ b/tests/accounts/test_accounts.py @@ -1,4 +1,5 @@ import pytest + from accounts.forms import EmployeeRegistrationForm @@ -8,4 +9,4 @@ class TestEmployeeRegistrationForm: def test__clean__ok(self): form = EmployeeRegistrationForm() form.save() - assert form.fields['first_name'].label == 'First Name' + assert form.fields["first_name"].label == "First Name" diff --git a/tests/factories.py b/tests/factories.py index 4cf4e856..f23dbb99 100644 --- a/tests/factories.py +++ b/tests/factories.py @@ -1,23 +1,24 @@ import factory -from jobsapp.models import User, Job + +from jobsapp.models import Job, User # List of factories class UserFactory(factory.django.DjangoModelFactory): class Meta: model = User - django_get_or_create = ('first_name', 'last_name') + django_get_or_create = ("first_name", "last_name") - first_name = 'John' - last_name = 'Doe' + first_name = "John" + last_name = "Doe" class JobFactory(factory.django.DjangoModelFactory): class Meta: model = Job - django_get_or_create = ('type') + django_get_or_create = "type" - user = factory.SubFactory('jobsapp.tests.UserFactory') - title = factory.Sequence(lambda n: 'Title %d' % n) - description = factory.Sequence(lambda n: 'Description %d' % n) - type = '1' + user = factory.SubFactory("jobsapp.tests.UserFactory") + title = factory.Sequence(lambda n: "Title %d" % n) + description = factory.Sequence(lambda n: "Description %d" % n) + type = "1" diff --git a/tests/jobsapp/test_jopsapp.py b/tests/jobsapp/test_jopsapp.py index a81a4df6..9da5c77b 100644 --- a/tests/jobsapp/test_jopsapp.py +++ b/tests/jobsapp/test_jopsapp.py @@ -1,4 +1,5 @@ import pytest + from tests.factories import UserFactory @@ -6,5 +7,5 @@ @pytest.mark.django_db class TestExampe: def test__exemple__ok(self): - user = UserFactory(first_name='Geeks', last_name='.CAT') - assert user.first_name == 'Geeks' + user = UserFactory(first_name="Geeks", last_name=".CAT") + assert user.first_name == "Geeks"