We planned to upgrade GitLab and Mattermost to the latest version this Friday morning (early). You may experience some downtime!

Commit 11f914e3 authored by Jelle Besseling's avatar Jelle Besseling

Merge branch 'fix-renewal-form-members' into 'master'

Add test values for no_references post value

See merge request !1329
parents 723bbcbb 29178c87
......@@ -672,6 +672,7 @@ class RenewalFormViewTest(TestCase):
request = super_post.call_args[0][0]
self.assertEqual(request.POST['member'], 2)
self.assertEqual(request.POST['remarks'], '')
self.assertEqual(request.POST['no_references'], True)
with self.subTest('Forced benefactor type'):
request = self.rf.post('/', {
......@@ -689,6 +690,7 @@ class RenewalFormViewTest(TestCase):
self.assertEqual(request.POST['membership_type'],
Membership.BENEFACTOR)
self.assertEqual(request.POST['length'], Entry.MEMBERSHIP_YEAR)
self.assertEqual(request.POST['no_references'], False)
with self.subTest('Detects old memberships'):
request = self.rf.post('/', {
......@@ -703,6 +705,7 @@ class RenewalFormViewTest(TestCase):
request = super_post.call_args[0][0]
self.assertEqual(request.POST['remarks'],
'Was a Thalia member in the past.')
self.assertEqual(request.POST['no_references'], True)
with self.subTest('Adds iCIS remark'):
request = self.rf.post('/', {
......@@ -718,6 +721,7 @@ class RenewalFormViewTest(TestCase):
request = super_post.call_args[0][0]
self.assertEqual(request.POST['remarks'],
'Registered as iCIS employee.')
self.assertEqual(request.POST['no_references'], True)
@mock.patch('registrations.emails.send_references_information_message')
@mock.patch('registrations.emails.send_new_renewal_board_message')
......
......@@ -228,9 +228,10 @@ class RenewalFormView(FormView):
request.POST['length'] = Entry.MEMBERSHIP_YEAR
request.POST['member'] = request.member.pk
request.POST['remarks'] = ''
request.POST['no_references'] = False
request.POST['no_references'] = True
if request.POST['membership_type'] == Membership.BENEFACTOR:
request.POST['no_references'] = False
if Membership.objects.filter(user=request.member,
type=Membership.MEMBER).exists():
request.POST['remarks'] = 'Was a Thalia member in the past.'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment