Skip to content

Commit

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


class TestIndependentPasswordValidator(PasswordValidatorTestCase):
user = User.objects.filter(
new_teacher__isnull=True, new_student__isnull=True
).first()
validator = IndependentPasswordValidator()
@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()

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


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

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


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

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

0 comments on commit 92ebe0c

Please sign in to comment.