...
 
Commits (2)
...@@ -672,6 +672,7 @@ class RenewalFormViewTest(TestCase): ...@@ -672,6 +672,7 @@ class RenewalFormViewTest(TestCase):
request = super_post.call_args[0][0] request = super_post.call_args[0][0]
self.assertEqual(request.POST['member'], 2) self.assertEqual(request.POST['member'], 2)
self.assertEqual(request.POST['remarks'], '') self.assertEqual(request.POST['remarks'], '')
self.assertEqual(request.POST['no_references'], True)
with self.subTest('Forced benefactor type'): with self.subTest('Forced benefactor type'):
request = self.rf.post('/', { request = self.rf.post('/', {
...@@ -689,6 +690,7 @@ class RenewalFormViewTest(TestCase): ...@@ -689,6 +690,7 @@ class RenewalFormViewTest(TestCase):
self.assertEqual(request.POST['membership_type'], self.assertEqual(request.POST['membership_type'],
Membership.BENEFACTOR) Membership.BENEFACTOR)
self.assertEqual(request.POST['length'], Entry.MEMBERSHIP_YEAR) self.assertEqual(request.POST['length'], Entry.MEMBERSHIP_YEAR)
self.assertEqual(request.POST['no_references'], False)
with self.subTest('Detects old memberships'): with self.subTest('Detects old memberships'):
request = self.rf.post('/', { request = self.rf.post('/', {
...@@ -703,6 +705,7 @@ class RenewalFormViewTest(TestCase): ...@@ -703,6 +705,7 @@ class RenewalFormViewTest(TestCase):
request = super_post.call_args[0][0] request = super_post.call_args[0][0]
self.assertEqual(request.POST['remarks'], self.assertEqual(request.POST['remarks'],
'Was a Thalia member in the past.') 'Was a Thalia member in the past.')
self.assertEqual(request.POST['no_references'], True)
with self.subTest('Adds iCIS remark'): with self.subTest('Adds iCIS remark'):
request = self.rf.post('/', { request = self.rf.post('/', {
...@@ -718,6 +721,7 @@ class RenewalFormViewTest(TestCase): ...@@ -718,6 +721,7 @@ class RenewalFormViewTest(TestCase):
request = super_post.call_args[0][0] request = super_post.call_args[0][0]
self.assertEqual(request.POST['remarks'], self.assertEqual(request.POST['remarks'],
'Registered as iCIS employee.') 'Registered as iCIS employee.')
self.assertEqual(request.POST['no_references'], True)
@mock.patch('registrations.emails.send_references_information_message') @mock.patch('registrations.emails.send_references_information_message')
@mock.patch('registrations.emails.send_new_renewal_board_message') @mock.patch('registrations.emails.send_new_renewal_board_message')
......
...@@ -228,9 +228,10 @@ class RenewalFormView(FormView): ...@@ -228,9 +228,10 @@ class RenewalFormView(FormView):
request.POST['length'] = Entry.MEMBERSHIP_YEAR request.POST['length'] = Entry.MEMBERSHIP_YEAR
request.POST['member'] = request.member.pk request.POST['member'] = request.member.pk
request.POST['remarks'] = '' request.POST['remarks'] = ''
request.POST['no_references'] = False request.POST['no_references'] = True
if request.POST['membership_type'] == Membership.BENEFACTOR: if request.POST['membership_type'] == Membership.BENEFACTOR:
request.POST['no_references'] = False
if Membership.objects.filter(user=request.member, if Membership.objects.filter(user=request.member,
type=Membership.MEMBER).exists(): type=Membership.MEMBER).exists():
request.POST['remarks'] = 'Was a Thalia member in the past.' request.POST['remarks'] = 'Was a Thalia member in the past.'
......