UI test fixed for supplier quotation (#11260)

* UI test fixed for supplier quotation

* ui test fixes for purchase order

* Fixed number of assertion in student admission test

* Fixed multiple ui tests

* ui tests
This commit is contained in:
Nabin Hait
2017-10-21 10:44:30 +05:30
committed by GitHub
parent 5a4d5bfaf2
commit 4825eccad5
8 changed files with 18 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
QUnit.module('schools');
QUnit.test('Test: Student Admission', function(assert) {
assert.expect(9);
assert.expect(10);
let done = assert.async();
frappe.run_serially([
() => {

View File

@@ -41,9 +41,14 @@ class StudentApplicant(Document):
def validation_from_student_admission(self):
student_admission = get_student_admission_data(self.student_admission, self.program)
if student_admission:
if not (getdate(student_admission.minimum_age) >= getdate(self.date_of_birth) >=
getdate(student_admission.maximum_age)):
frappe.throw(_("Not eligible for the admission in this program as per DOB"))
if ((
student_admission.minimum_age
and getdate(student_admission.minimum_age) > getdate(self.date_of_birth)
) or (
student_admission.maximum_age
and getdate(student_admission.maximum_age) < getdate(self.date_of_birth)
)):
frappe.throw(_("Not eligible for the admission in this program as per DOB"))
def on_payment_authorized(self, *args, **kwargs):
self.db_set('paid', 1)

View File

@@ -4,15 +4,10 @@ QUnit.module('schools');
QUnit.test('Test: Student Group', function(assert){
assert.expect(2);
let done = assert.async();
let instructor_code;
let group_based_on = ["test-batch-wise-group", "test-course-wise-group"];
let tasks = [];
frappe.run_serially([
// Saving Instructor code beforehand
() => frappe.db.get_value('Instructor', {'instructor_name': 'Instructor 1'}, 'name'),
(instructor) => {instructor_code = instructor.message.name;},
// Creating a Batch and Course based group
() => {
return frappe.tests.make('Student Group', [
@@ -22,12 +17,7 @@ QUnit.test('Test: Student Group', function(assert){
{group_based_on: 'Batch'},
{student_group_name: group_based_on[0]},
{max_strength: 10},
{batch: 'A'},
{instructors: [
[
{instructor: instructor_code}
]
]}
{batch: 'A'}
]);
},
() => {
@@ -40,11 +30,6 @@ QUnit.test('Test: Student Group', function(assert){
{max_strength: 10},
{batch: 'A'},
{course: 'Test_Sub'},
{instructors: [
[
{instructor: instructor_code}
]
]}
]);
},