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
diff --git a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
index d65fe99..5d19687 100644
--- a/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
@@ -1,7 +1,7 @@
QUnit.module('Buying');
QUnit.test("test: purchase order", function(assert) {
- assert.expect(17);
+ assert.expect(16);
let done = assert.async();
frappe.run_serially([
@@ -40,7 +40,6 @@
// Get supplier details
assert.ok(cur_frm.doc.supplier_name == 'Test Supplier', "Supplier name correct");
assert.ok(cur_frm.doc.schedule_date == frappe.datetime.add_days(frappe.datetime.now_date(), 1), "Schedule Date correct");
- assert.ok($('div.control-value.like-disabled-input.for-description').text().includes('Contact 3'), "Contact display correct");
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Contact email correct");
// Get item details
assert.ok(cur_frm.doc.items[0].item_name == 'Test Product 4', "Item name correct");
diff --git a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
index 54117fe..2d2b29c 100644
--- a/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
+++ b/erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
@@ -33,7 +33,7 @@
assert.ok(cur_frm.doc.supplier == 'Test Supplier', "Supplier correct");
assert.ok(cur_frm.doc.company == cur_frm.doc.company, "Company correct");
// Get Contact details
- assert.ok(cur_frm.doc.contact_display == 'Contact 3', "Conatct correct");
+ assert.ok(cur_frm.doc.contact_person == 'Contact 3-Test Supplier', "Conatct correct");
assert.ok(cur_frm.doc.contact_email == 'test@supplier.com', "Email correct");
// Get uom
assert.ok(cur_frm.doc.items[0].uom == 'Unit', "Multi uom correct");
diff --git a/erpnext/restaurant/doctype/restaurant/test_restaurant.js b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
index 6e1f141..f4a1343 100644
--- a/erpnext/restaurant/doctype/restaurant/test_restaurant.js
+++ b/erpnext/restaurant/doctype/restaurant/test_restaurant.js
@@ -15,7 +15,8 @@
// values to be set
{__newname: 'Test Restaurant 1'},
{company: 'Test Company'},
- {invoice_series_prefix: 'Test-Rest-1-Inv-'}
+ {invoice_series_prefix: 'Test-Rest-1-Inv-'},
+ {default_customer: 'Test Customer 1'}
])
},
() => frappe.timeout(3),
@@ -27,7 +28,8 @@
// values to be set
{__newname: 'Test Restaurant 2'},
{company: 'Test Company'},
- {invoice_series_prefix: 'Test-Rest-3-Inv-'}
+ {invoice_series_prefix: 'Test-Rest-3-Inv-'},
+ {default_customer: 'Test Customer 2'}
]);
},
() => frappe.timeout(3),
diff --git a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
index 7dca139..f5ab9f0 100644
--- a/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
+++ b/erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
@@ -16,7 +16,7 @@
{item_group: "Products"},
{is_stock_item: 1},
],
- "Test Product 3": [
+ "Food Item 3": [
{item_code: "Food Item 3"},
{item_group: "Products"},
{is_stock_item: 1},
diff --git a/erpnext/schools/doctype/student_admission/test_student_admission.js b/erpnext/schools/doctype/student_admission/test_student_admission.js
index 3e997ca..767f237 100644
--- a/erpnext/schools/doctype/student_admission/test_student_admission.js
+++ b/erpnext/schools/doctype/student_admission/test_student_admission.js
@@ -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([
() => {
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/schools/doctype/student_applicant/student_applicant.py
index 7fa44a6..465b4e4 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.py
+++ b/erpnext/schools/doctype/student_applicant/student_applicant.py
@@ -41,9 +41,14 @@
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)
diff --git a/erpnext/schools/doctype/student_group/test_student_group.js b/erpnext/schools/doctype/student_group/test_student_group.js
index 634ad18..bee5067 100644
--- a/erpnext/schools/doctype/student_group/test_student_group.js
+++ b/erpnext/schools/doctype/student_group/test_student_group.js
@@ -4,15 +4,10 @@
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 @@
{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 @@
{max_strength: 10},
{batch: 'A'},
{course: 'Test_Sub'},
- {instructors: [
- [
- {instructor: instructor_code}
- ]
- ]}
]);
},
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
index 4b3c2c5..38c138d 100644
--- a/erpnext/tests/ui/tests.txt
+++ b/erpnext/tests/ui/tests.txt
@@ -131,6 +131,6 @@
erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js
erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
erpnext/restaurant/doctype/restaurant/test_restaurant.js
-erpnext/restaurant/doctype/test_restaurant_table/test_restaurant_table.js
+erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js
erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js