Adding Test Utils
diff --git a/erpnext/education/doctype/course/test_course.py b/erpnext/education/doctype/course/test_course.py
index b18f4a9..9e0d185 100644
--- a/erpnext/education/doctype/course/test_course.py
+++ b/erpnext/education/doctype/course/test_course.py
@@ -10,3 +10,11 @@
class TestCourse(unittest.TestCase):
pass
+
+def make_course(name):
+ course = frappe.get_doc({
+ "doctype": "Program",
+ "course_name": name,
+ "course_code": name
+ }).insert()
+ return course.name
\ No newline at end of file
diff --git a/erpnext/education/doctype/program/test_program.py b/erpnext/education/doctype/program/test_program.py
index a4accda..c67f393 100644
--- a/erpnext/education/doctype/program/test_program.py
+++ b/erpnext/education/doctype/program/test_program.py
@@ -2,6 +2,7 @@
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
+from erpnext.education.doctype.course.test_course import make_course
import frappe
import unittest
@@ -10,3 +11,27 @@
class TestProgram(unittest.TestCase):
pass
+
+
+def make_program(name):
+ program = frappe.get_doc({
+ "doctype": "Program",
+ "program_name": name,
+ "program_code": name,
+ "is_published": True,
+ "is_featured": True,
+ }).insert()
+ return program.name
+
+def make_program_and_linked_courses(program_name, course_name_list):
+ try:
+ program = frappe.get_doc("Program", program_name)
+ except frappe.DoesNotExistError:
+ make_program(program_name)
+ program = frappe.get_doc("Program", program_name)
+ course_list = [make_course(course_name) for course_name in course_name_list]
+ for course in course_list:
+ program.append("courses", {"course": course})
+ program.save()
+ return program.name
+
diff --git a/erpnext/education/doctype/student/student.py b/erpnext/education/doctype/student/student.py
index f6360c3..0f126ca 100644
--- a/erpnext/education/doctype/student/student.py
+++ b/erpnext/education/doctype/student/student.py
@@ -55,7 +55,6 @@
student_user.save()
self.user = student_user.name
self.save()
- frappe.publish_realtime('enroll_student_progress', {"progress": [4, 4]}, user=frappe.session.user)
update_password_link = student_user.reset_password()
print(update_password_link)
diff --git a/erpnext/education/doctype/student/test_student.py b/erpnext/education/doctype/student/test_student.py
index cc6537f..81e809e 100644
--- a/erpnext/education/doctype/student/test_student.py
+++ b/erpnext/education/doctype/student/test_student.py
@@ -2,11 +2,12 @@
# Copyright (c) 2015, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
+from frappe.test_runner import make_test_records
+from erpnext.education.doctype.program.test_program import make_program_and_linked_courses
import frappe
import unittest
-# test_records = frappe.get_test_records('Student')
-
+test_records = frappe.get_test_records('Student')
class TestStudent(unittest.TestCase):
pass
diff --git a/erpnext/www/test_lms.py b/erpnext/www/test_lms.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/www/test_lms.py