Skip to content
Snippets Groups Projects
Commit a52ba9f6 authored by Marte Fossum's avatar Marte Fossum
Browse files

Fix backend lint and test

parent d90fd548
No related branches found
No related tags found
No related merge requests found
Pipeline #160473 failed
This commit is part of merge request !351. Comments created here will be created in the context of that merge request.
from greg.utils import is_valid_id_number, is_valid_so_number
from django.conf import settings from django.conf import settings
from greg.utils import is_valid_id_number, is_valid_so_number
def test_so_number(): def test_so_number():
...@@ -12,12 +12,12 @@ def test_so_number(): ...@@ -12,12 +12,12 @@ def test_so_number():
def test_not_allow_so_number(): def test_not_allow_so_number():
so_number = "25529312345" so_number = "25529312345"
settings.ALLOW_SO_NUMBERS = False settings.ALLOW_SO_NUMBERS = False
assert is_valid_id_number(so_number) == False assert not is_valid_id_number(so_number)
assert is_valid_so_number(so_number) == False assert not is_valid_so_number(so_number)
def test_not_valid_so_number(): def test_not_valid_so_number():
so_number = "25529322345" so_number = "25529322345"
settings.ALLOW_SO_NUMBERS = True settings.ALLOW_SO_NUMBERS = True
assert is_valid_id_number(so_number) == False assert not is_valid_id_number(so_number)
assert is_valid_so_number(so_number) == False assert not is_valid_so_number(so_number)
...@@ -40,8 +40,8 @@ def is_valid_so_number(input_digits: str) -> bool: ...@@ -40,8 +40,8 @@ def is_valid_so_number(input_digits: str) -> bool:
return False return False
if month > 50: if month > 50:
SO_NUMBER = True SO_NUMBER = True
month = _check_month(month) month_str = _check_month(month)
input_digits = day + month + year + pnr input_digits = day + month_str + year + pnr
return SO_NUMBER and _check_birthdate(input_digits, is_dnumber=False) return SO_NUMBER and _check_birthdate(input_digits, is_dnumber=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment