feat: update test records

This commit is contained in:
Shivam Mishra 2020-08-11 14:29:06 +05:30
parent 2dc96252bd
commit 5df22dcdcc
4 changed files with 3 additions and 9 deletions

View file

@ -26,8 +26,7 @@ class TestUserPermission(unittest.TestCase):
user = create_user('test_user_perm1@example.com', 'Website Manager')
for category in ['general', 'public']:
if not frappe.db.exists('Blog Category', category):
frappe.get_doc({'doctype': 'Blog Category',
'category_name': category, 'title': category}).insert()
frappe.get_doc({'doctype': 'Blog Category', 'title': category}).insert()
param = get_params(user, 'Blog Category', 'general', is_default=1)
add_user_permissions(param)

View file

@ -7,8 +7,7 @@ import frappe
class TestBlogCategory(unittest.TestCase):
def test_route(self):
cat = frappe.new_doc("Blog Categroy", {
"title": "_Yet Another Category",
"category_name": "test-category-yet-another-category",
"title": "Test Category Yet Another Category",
})
cat.insert()
self.assertEqual(cat.route, 'blog/test-category-yet-another-category')

View file

@ -1,18 +1,15 @@
[
{
"category_name": "_Test Blog Category",
"doctype": "Blog Category",
"parent_website_route": "blog",
"title": "_Test Blog Category"
},
{
"category_name": "_Test Blog Category 1",
"doctype": "Blog Category",
"parent_website_route": "blog",
"title": "_Test Blog Category 1"
},
{
"category_name": "_Test Blog Category 2",
"doctype": "Blog Category",
"parent_website_route": "blog",
"title": "_Test Blog Category 2"

View file

@ -36,7 +36,6 @@ def make_test_blog():
if not frappe.db.exists('Blog Category', 'Test Blog Category'):
frappe.get_doc(dict(
doctype = 'Blog Category',
category_name = 'Test Blog Category',
title='Test Blog Category')).insert()
if not frappe.db.exists('Blogger', 'test-blogger'):
frappe.get_doc(dict(
@ -45,7 +44,7 @@ def make_test_blog():
full_name='Test Blogger')).insert()
test_blog = frappe.get_doc(dict(
doctype = 'Blog Post',
blog_category = 'Test Blog Category',
blog_category = 'test-blog-category',
blogger = 'test-blogger',
title = random_string(20),
route = random_string(20),