test: users with same name, username validations, users without username

This commit is contained in:
pateljannat
2021-04-28 22:04:42 +05:30
parent 7a40b3e7a5
commit a022804381
3 changed files with 85 additions and 7 deletions

View File

@@ -36,7 +36,10 @@ class TestLMSCourse(unittest.TestCase):
mentors = course.get_mentors()
mentors_data = [dict(email=mentor.email, batch_count=mentor.batch_count) for mentor in mentors]
assert mentors_data == [{"email": "tester@example.com", "batch_count": 0}]
frappe.delete_doc("User", user.name)
def tearDown(self):
if frappe.db.exists("User", "tester@example.com"):
frappe.delete_doc("User", "tester@example.com")
def new_user(name, email):
doc = frappe.get_doc(dict(