From 6e53afd947974b576cdb059847b596ac36fc8ed1 Mon Sep 17 00:00:00 2001 From: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com> Date: Thu, 20 Feb 2020 23:33:35 +0530 Subject: [PATCH] fix: Travis (#20688) * fix: Travis * fix: Update test records Co-authored-by: Chinmay Pai --- .../education/doctype/student_group/student_group.py | 4 ++-- .../doctype/student_group/test_records.json | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/erpnext/education/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py index 2925469312d..8b61c899bc0 100644 --- a/erpnext/education/doctype/student_group/student_group.py +++ b/erpnext/education/doctype/student_group/student_group.py @@ -26,8 +26,8 @@ class StudentGroup(Document): frappe.throw(_("Please select Program")) def validate_strength(self): - if self.max_strength <= 0: - frappe.throw(_("""Max strength must be greater than zero.""")) + if cint(self.max_strength) < 0: + frappe.throw(_("""Max strength cannot be less than zero.""")) if self.max_strength and len(self.students) > self.max_strength: frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength)) diff --git a/erpnext/education/doctype/student_group/test_records.json b/erpnext/education/doctype/student_group/test_records.json index c36c9b297c4..4c4e042b152 100644 --- a/erpnext/education/doctype/student_group/test_records.json +++ b/erpnext/education/doctype/student_group/test_records.json @@ -5,26 +5,30 @@ "program": "_TP1", "batch": "_Batch 1", "academic_year": "2014-2015", - "academic_term": "2014-2015 (_Test Academic Term)" + "academic_term": "2014-2015 (_Test Academic Term)", + "max_strength": 0 }, { "student_group_name": "Course-TC101-2014-2015 (_Test Academic Term)", "group_based_on": "Course", "course": "TC101", "academic_year": "2014-2015", - "academic_term": "2014-2015 (_Test Academic Term)" + "academic_term": "2014-2015 (_Test Academic Term)", + "max_strength": 0 }, { "student_group_name": "Course-TC102-2014-2015 (_Test Academic Term)", "group_based_on": "Course", "course": "TC102", "academic_year": "2014-2015", - "academic_term": "2014-2015 (_Test Academic Term)" + "academic_term": "2014-2015 (_Test Academic Term)", + "max_strength": 0 }, { "student_group_name": "Activity-2014-2015 (_Test Academic Term)", "group_based_on": "Activity", "academic_year": "2014-2015", - "academic_term": "2014-2015 (_Test Academic Term)" + "academic_term": "2014-2015 (_Test Academic Term)", + "max_strength": 0 } ] \ No newline at end of file