Skip to content

Commit 466928e

Browse files
committed
Only generate the test NomCom certificate once instead to speed up the
Nomcom tests a bit - Legacy-Id: 6919
1 parent 652a5ca commit 466928e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ietf/nomcom/test_data.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def check_comments(encryped, plain, privatekey_file):
9393

9494
return decrypted_comments == plain
9595

96+
test_cert_file = None
97+
9698
def nomcom_test_data():
9799
# groups
98100
group, created = Group.objects.get_or_create(name='IAB/IESG Nominating Committee 2013/2014',
@@ -102,8 +104,10 @@ def nomcom_test_data():
102104

103105
nomcom, created = NomCom.objects.get_or_create(group=group)
104106

105-
cert_file, privatekey_file = generate_cert()
106-
nomcom.public_key.save('cert', File(open(cert_file.name, 'r')))
107+
global test_cert_file
108+
if not test_cert_file:
109+
test_cert_file, privatekey_file = generate_cert()
110+
nomcom.public_key.save('cert', File(open(test_cert_file.name, 'r')))
107111

108112
# chair and member
109113
create_person(group, "chair", username=CHAIR_USER)

0 commit comments

Comments
 (0)