fix: Travis (#20688)

* fix: Travis

* fix: Update test records

Co-authored-by: Chinmay Pai <chinmaydpai@gmail.com>
This commit is contained in:
Deepesh Garg 2020-02-20 23:33:35 +05:30 committed by GitHub
parent d52354f131
commit 6e53afd947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -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))

View File

@ -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
}
]