Skip to content

Commit

Permalink
Merge pull request #81 from GeeksCAT/fix/massive_lint
Browse files Browse the repository at this point in the history
Massive code lint
  • Loading branch information
jbagot authored Oct 14, 2020
2 parents 2d84123 + ef8a39c commit d00d58a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion jobs/settings/testing.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import * #noqa
from . import * # noqa
1 change: 1 addition & 0 deletions jobsapp/views/employer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/accounts/test_accounts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from accounts.forms import EmployeeRegistrationForm


Expand All @@ -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"
19 changes: 10 additions & 9 deletions tests/factories.py
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 3 additions & 2 deletions tests/jobsapp/test_jopsapp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import pytest

from tests.factories import UserFactory


# Create your tests here.
@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"

0 comments on commit d00d58a

Please sign in to comment.