Upper case only in the random notification id generator

as DVLA need upper case only or the barcode doesn't generate.
This commit is contained in:
Martyn Inglis
2017-04-20 10:55:53 +01:00
parent 67002cd608
commit 5550201939
2 changed files with 2 additions and 4 deletions

View File

@@ -211,7 +211,7 @@ def create_uuid():
def create_random_identifier():
return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16))
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(16))
def process_user_agent(user_agent_string):

View File

@@ -1044,9 +1044,7 @@ def test_create_dvla_file_contents(sample_letter_template, mocker):
def test_dvla_letter_template(sample_letter_notification):
t = {"content": sample_letter_notification.template.content,
"subject": sample_letter_notification.template.subject}
letter = LetterDVLATemplate(t,
sample_letter_notification.personalisation,
"random-string")
letter = LetterDVLATemplate(t, sample_letter_notification.personalisation, "random-string")
assert str(letter) == "140|500|001||random-string|||||||||||||A1||A2|A3|A4|A5|A6|A_POST|||||||||23 March 2017<cr><cr><h1>Template subject<normal><cr><cr>Dear Sir/Madam, Hello. Yours Truly, The Government.<cr><cr>" # noqa