Skip to content

Commit

Permalink
Stop using setup class
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Jan 31, 2024
1 parent 4bd0f5a commit 1134b88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@


class TestIndependentPasswordValidator(PasswordValidatorTestCase):
@classmethod
def setUpClass(cls):
cls.user = User.objects.filter(
new_teacher__isnull=True, new_student__isnull=True
).first()
cls.validator = IndependentPasswordValidator()
super(TestIndependentPasswordValidator, cls).setUpClass()
user = User.objects.filter(
new_teacher__isnull=True, new_student__isnull=True
).first()
validator = IndependentPasswordValidator()

def test_validate__password_too_short(self):
password = "fxwSn4}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@


class TestStudentPasswordValidator(PasswordValidatorTestCase):
@classmethod
def setUpClass(cls):
cls.user = User.objects.filter(new_student__isnull=False).first()
cls.validator = StudentPasswordValidator()
super(TestStudentPasswordValidator, cls).setUpClass()
user = User.objects.filter(new_student__isnull=False).first()
validator = StudentPasswordValidator()

def test_validate__password_too_short(self):
password = "fxwSn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@


class TestTeacherPasswordValidator(PasswordValidatorTestCase):
@classmethod
def setUpClass(cls):
cls.user = User.objects.first()
cls.validator = TeacherPasswordValidator()
super(TestTeacherPasswordValidator, cls).setUpClass()
user = User.objects.first()
validator = TeacherPasswordValidator()

def test_validate__password_too_short(self):
password = "fxwSn4}PW"
Expand Down

0 comments on commit 1134b88

Please sign in to comment.