From ffa27d98eb59437d99d3ae16fde6f7654c121f2a Mon Sep 17 00:00:00 2001 From: satya7289 Date: Thu, 20 Aug 2020 13:21:27 +0530 Subject: [PATCH] feat: Update Testcases for python- 3.8 --- systers_portal/meetup/tests/test_forms.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/systers_portal/meetup/tests/test_forms.py b/systers_portal/meetup/tests/test_forms.py index 203b502b..cae176b7 100644 --- a/systers_portal/meetup/tests/test_forms.py +++ b/systers_portal/meetup/tests/test_forms.py @@ -61,9 +61,9 @@ def test_request_meetup_form_with_past_date(self): date = (timezone.now() - timedelta(2)).date() time = timezone.now().time() data = {'title': 'Foo', 'slug': 'foo', 'date': date, 'time': time, - 'meetup_location': self.location, + 'meetup_location': self.location.id, 'description': "It's a test meetup."} - form = AddMeetupForm(data=data, created_by=self.systers_user, leader=self.systers_user) + form = RequestMeetupForm(data=data, created_by=self.systers_user) self.assertFalse(form.is_valid()) self.assertTrue(form.errors['date'], ["Date should not be before today's date."]) @@ -72,13 +72,12 @@ def test_request_meetup_form_with_passed_time(self): date = timezone.now().date() time = (timezone.now() - timedelta(2)).time() data = {'title': 'Foo', 'slug': 'foo', 'date': date, 'time': time, - 'meetup_location': self.location, + 'meetup_location': self.location.id, 'description': "It's a test meetup."} - form = AddMeetupForm(data=data, created_by=self.systers_user, leader=self.systers_user) + form = RequestMeetupForm(data=data, created_by=self.systers_user) self.assertFalse(form.is_valid()) self.assertTrue(form.errors['time'], ["Time should not be a time that has already passed."]) - self.assertRaises(ValidationError, form.clean_time()) class AddMeetupFormTestCase(MeetupFormTestCaseBase, TestCase):