* test: undo custom field creation (cherry picked from commitversion-1441af9621cd
) * test: Use FrappeTestCase everywhere (cherry picked from commit3e2d2a703a
) # Conflicts: # frappe/printing/doctype/print_format/test_print_format.py # frappe/tests/test_commands.py # frappe/tests/test_config.py # frappe/tests/test_oauth20.py # frappe/tests/test_translate.py # frappe/tests/test_utils.py * fix: dont use sendmail with now=True (cherry picked from commit1c9ea57279
) * test: skip badly written test temporarily (cherry picked from commit613d8472b4
) * chore: conflicts Co-authored-by: Ankush Menat <ankush@frappe.io> Co-authored-by: phot0n <ritwikpuri5678@gmail.com>
@@ -1,16 +1,16 @@ | |||||
# Copyright (c) 2021, Frappe Technologies and Contributors | # Copyright (c) 2021, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.test_runner import make_test_records | from frappe.test_runner import make_test_records | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import random_string | from frappe.utils import random_string | ||||
class TestAutoAssign(unittest.TestCase): | |||||
class TestAutoAssign(FrappeTestCase): | |||||
@classmethod | @classmethod | ||||
def setUpClass(cls): | def setUpClass(cls): | ||||
super().setUpClass() | |||||
frappe.db.delete("Assignment Rule") | frappe.db.delete("Assignment Rule") | ||||
@classmethod | @classmethod | ||||
@@ -274,6 +274,7 @@ class TestAutoAssign(unittest.TestCase): | |||||
self.assertNotEqual(frappe.utils.get_date_str(note2_todo.date), note1.expiry_date) | self.assertNotEqual(frappe.utils.get_date_str(note2_todo.date), note1.expiry_date) | ||||
self.assertEqual(frappe.utils.get_date_str(note2_todo.date), expiry_date) | self.assertEqual(frappe.utils.get_date_str(note2_todo.date), expiry_date) | ||||
assignment_rule.delete() | assignment_rule.delete() | ||||
frappe.db.commit() # undo changes commited by DDL | |||||
def clear_assignments(): | def clear_assignments(): | ||||
@@ -1,7 +1,5 @@ | |||||
# Copyright (c) 2018, Frappe Technologies and Contributors | # Copyright (c) 2018, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.automation.doctype.auto_repeat.auto_repeat import ( | from frappe.automation.doctype.auto_repeat.auto_repeat import ( | ||||
create_repeated_entries, | create_repeated_entries, | ||||
@@ -9,6 +7,7 @@ from frappe.automation.doctype.auto_repeat.auto_repeat import ( | |||||
week_map, | week_map, | ||||
) | ) | ||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_field | from frappe.custom.doctype.custom_field.custom_field import create_custom_field | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import add_days, add_months, getdate, today | from frappe.utils import add_days, add_months, getdate, today | ||||
@@ -26,7 +25,7 @@ def add_custom_fields(): | |||||
create_custom_field("ToDo", df) | create_custom_field("ToDo", df) | ||||
class TestAutoRepeat(unittest.TestCase): | |||||
class TestAutoRepeat(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
if not frappe.db.sql( | if not frappe.db.sql( | ||||
"SELECT `fieldname` FROM `tabCustom Field` WHERE `fieldname`='auto_repeat' and `dt`=%s", "Todo" | "SELECT `fieldname` FROM `tabCustom Field` WHERE `fieldname`='auto_repeat' and `dt`=%s", "Todo" | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestMilestone(unittest.TestCase): | |||||
class TestMilestone(FrappeTestCase): | |||||
pass | pass |
@@ -1,12 +1,11 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
import frappe.cache_manager | import frappe.cache_manager | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestMilestoneTracker(unittest.TestCase): | |||||
class TestMilestoneTracker(FrappeTestCase): | |||||
def test_milestone(self): | def test_milestone(self): | ||||
frappe.db.delete("Milestone Tracker") | frappe.db.delete("Milestone Tracker") | ||||
@@ -1,12 +1,11 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.contacts.doctype.address.address import get_address_display | from frappe.contacts.doctype.address.address import get_address_display | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestAddress(unittest.TestCase): | |||||
class TestAddress(FrappeTestCase): | |||||
def test_template_works(self): | def test_template_works(self): | ||||
if not frappe.db.exists("Address Template", "India"): | if not frappe.db.exists("Address Template", "India"): | ||||
frappe.get_doc({"doctype": "Address Template", "country": "India", "is_default": 1}).insert() | frappe.get_doc({"doctype": "Address Template", "country": "India", "is_default": 1}).insert() | ||||
@@ -1,11 +1,10 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestAddressTemplate(unittest.TestCase): | |||||
class TestAddressTemplate(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
self.make_default_address_template() | self.make_default_address_template() | ||||
@@ -1,13 +1,12 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_dependencies = ["Contact", "Salutation"] | test_dependencies = ["Contact", "Salutation"] | ||||
class TestContact(unittest.TestCase): | |||||
class TestContact(FrappeTestCase): | |||||
def test_check_default_email(self): | def test_check_default_email(self): | ||||
emails = [ | emails = [ | ||||
{"email": "test1@example.com", "is_primary": 0}, | {"email": "test1@example.com", "is_primary": 0}, | ||||
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestGender(unittest.TestCase): | |||||
class TestGender(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestSalutation(unittest.TestCase): | |||||
class TestSalutation(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,7 @@ | |||||
import unittest | |||||
import frappe | import frappe | ||||
import frappe.defaults | import frappe.defaults | ||||
from frappe.contacts.report.addresses_and_contacts.addresses_and_contacts import get_data | from frappe.contacts.report.addresses_and_contacts.addresses_and_contacts import get_data | ||||
from frappe.tests.utils import FrappeTestCase | |||||
def get_custom_linked_doctype(): | def get_custom_linked_doctype(): | ||||
@@ -87,7 +86,7 @@ def create_linked_contact(link_list, address): | |||||
frappe.flags.test_contact_created = True | frappe.flags.test_contact_created = True | ||||
class TestAddressesAndContacts(unittest.TestCase): | |||||
class TestAddressesAndContacts(FrappeTestCase): | |||||
def test_get_data(self): | def test_get_data(self): | ||||
linked_docs = [get_custom_doc_for_address_and_contacts()] | linked_docs = [get_custom_doc_for_address_and_contacts()] | ||||
links_list = [item.name for item in linked_docs] | links_list = [item.name for item in linked_docs] | ||||
@@ -4,9 +4,6 @@ | |||||
import base64 | import base64 | ||||
import os | import os | ||||
# imports - standard imports | |||||
import unittest | |||||
# imports - third party imports | # imports - third party imports | ||||
import requests | import requests | ||||
@@ -15,10 +12,13 @@ import frappe | |||||
from frappe.core.doctype.access_log.access_log import make_access_log | from frappe.core.doctype.access_log.access_log import make_access_log | ||||
from frappe.core.doctype.data_import.data_import import export_csv | from frappe.core.doctype.data_import.data_import import export_csv | ||||
from frappe.core.doctype.user.user import generate_keys | from frappe.core.doctype.user.user import generate_keys | ||||
# imports - standard imports | |||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import cstr, get_site_url | from frappe.utils import cstr, get_site_url | ||||
class TestAccessLog(unittest.TestCase): | |||||
class TestAccessLog(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
# generate keys for current user to send requests for the following tests | # generate keys for current user to send requests for the following tests | ||||
generate_keys(frappe.session.user) | generate_keys(frappe.session.user) | ||||
@@ -1,13 +1,13 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import time | import time | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.auth import CookieManager, LoginManager | from frappe.auth import CookieManager, LoginManager | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestActivityLog(unittest.TestCase): | |||||
class TestActivityLog(FrappeTestCase): | |||||
def test_activity_log(self): | def test_activity_log(self): | ||||
# test user login log | # test user login log | ||||
@@ -1,12 +1,12 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import json | import json | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestComment(unittest.TestCase): | |||||
class TestComment(FrappeTestCase): | |||||
def tearDown(self): | def tearDown(self): | ||||
frappe.form_dict.comment = None | frappe.form_dict.comment = None | ||||
frappe.form_dict.comment_email = None | frappe.form_dict.comment_email = None | ||||
@@ -1,6 +1,5 @@ | |||||
# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from typing import TYPE_CHECKING | from typing import TYPE_CHECKING | ||||
from urllib.parse import quote | from urllib.parse import quote | ||||
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Custom DocPerm') | # test_records = frappe.get_test_records('Custom DocPerm') | ||||
class TestCustomDocPerm(unittest.TestCase): | |||||
class TestCustomDocPerm(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Custom Role') | # test_records = frappe.get_test_records('Custom Role') | ||||
class TestCustomRole(unittest.TestCase): | |||||
class TestCustomRole(FrappeTestCase): | |||||
pass | pass |
@@ -1,12 +1,11 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.data_export.exporter import DataExporter | from frappe.core.doctype.data_export.exporter import DataExporter | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDataExporter(unittest.TestCase): | |||||
class TestDataExporter(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
self.doctype_name = "Test DocType for Export Tool" | self.doctype_name = "Test DocType for Export Tool" | ||||
self.doc_name = "Test Data for Export Tool" | self.doc_name = "Test Data for Export Tool" | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDataImport(unittest.TestCase): | |||||
class TestDataImport(FrappeTestCase): | |||||
pass | pass |
@@ -1,15 +1,14 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.data_import.exporter import Exporter | from frappe.core.doctype.data_import.exporter import Exporter | ||||
from frappe.core.doctype.data_import.test_importer import create_doctype_if_not_exists | from frappe.core.doctype.data_import.test_importer import create_doctype_if_not_exists | ||||
from frappe.tests.utils import FrappeTestCase | |||||
doctype_name = "DocType for Export" | doctype_name = "DocType for Export" | ||||
class TestExporter(unittest.TestCase): | |||||
class TestExporter(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
create_doctype_if_not_exists(doctype_name) | create_doctype_if_not_exists(doctype_name) | ||||
@@ -1,18 +1,18 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.data_import.importer import Importer | from frappe.core.doctype.data_import.importer import Importer | ||||
from frappe.tests.test_query_builder import db_type_is, run_only_if | from frappe.tests.test_query_builder import db_type_is, run_only_if | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import format_duration, getdate | from frappe.utils import format_duration, getdate | ||||
doctype_name = "DocType for Import" | doctype_name = "DocType for Import" | ||||
class TestImporter(unittest.TestCase): | |||||
class TestImporter(FrappeTestCase): | |||||
@classmethod | @classmethod | ||||
def setUpClass(cls): | def setUpClass(cls): | ||||
super().setUpClass() | |||||
create_doctype_if_not_exists( | create_doctype_if_not_exists( | ||||
doctype_name, | doctype_name, | ||||
) | ) | ||||
@@ -2,8 +2,8 @@ | |||||
# See license.txt | # See license.txt | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDataImportLog(unittest.TestCase): | |||||
class TestDataImportLog(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Deleted Document') | # test_records = frappe.get_test_records('Deleted Document') | ||||
class TestDeletedDocument(unittest.TestCase): | |||||
class TestDeletedDocument(FrappeTestCase): | |||||
pass | pass |
@@ -1,16 +1,15 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
import frappe.share | import frappe.share | ||||
from frappe.automation.doctype.auto_repeat.test_auto_repeat import create_submittable_doctype | from frappe.automation.doctype.auto_repeat.test_auto_repeat import create_submittable_doctype | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_dependencies = ["User"] | test_dependencies = ["User"] | ||||
class TestDocShare(unittest.TestCase): | |||||
class TestDocShare(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
self.user = "test@example.com" | self.user = "test@example.com" | ||||
self.event = frappe.get_doc( | self.event = frappe.get_doc( | ||||
@@ -2,7 +2,6 @@ | |||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import random | import random | ||||
import string | import string | ||||
import unittest | |||||
from unittest.mock import patch | from unittest.mock import patch | ||||
import frappe | import frappe | ||||
@@ -19,9 +18,10 @@ from frappe.core.doctype.doctype.doctype import ( | |||||
) | ) | ||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields | from frappe.custom.doctype.custom_field.custom_field import create_custom_fields | ||||
from frappe.desk.form.load import getdoc | from frappe.desk.form.load import getdoc | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDocType(unittest.TestCase): | |||||
class TestDocType(FrappeTestCase): | |||||
def tearDown(self): | def tearDown(self): | ||||
frappe.db.rollback() | frappe.db.rollback() | ||||
@@ -1,11 +1,10 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDocumentNamingRule(unittest.TestCase): | |||||
class TestDocumentNamingRule(FrappeTestCase): | |||||
def test_naming_rule_by_series(self): | def test_naming_rule_by_series(self): | ||||
naming_rule = frappe.get_doc( | naming_rule = frappe.get_doc( | ||||
dict(doctype="Document Naming Rule", document_type="ToDo", prefix="test-todo-", prefix_digits=5) | dict(doctype="Document Naming Rule", document_type="ToDo", prefix="test-todo-", prefix_digits=5) | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDocumentNamingRuleCondition(unittest.TestCase): | |||||
class TestDocumentNamingRuleCondition(FrappeTestCase): | |||||
pass | pass |
@@ -2,8 +2,8 @@ | |||||
# See license.txt | # See license.txt | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDocumentShareKey(unittest.TestCase): | |||||
class TestDocumentShareKey(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDomain(unittest.TestCase): | |||||
class TestDomain(FrappeTestCase): | |||||
pass | pass |
@@ -1,13 +1,12 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Error Log') | # test_records = frappe.get_test_records('Error Log') | ||||
class TestErrorLog(unittest.TestCase): | |||||
class TestErrorLog(FrappeTestCase): | |||||
def test_error_log(self): | def test_error_log(self): | ||||
"""let's do an error log on error log?""" | """let's do an error log on error log?""" | ||||
doc = frappe.new_doc("Error Log") | doc = frappe.new_doc("Error Log") | ||||
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Error Snapshot') | # test_records = frappe.get_test_records('Error Snapshot') | ||||
class TestErrorSnapshot(unittest.TestCase): | |||||
class TestErrorSnapshot(FrappeTestCase): | |||||
pass | pass |
@@ -3,7 +3,6 @@ | |||||
import base64 | import base64 | ||||
import json | import json | ||||
import os | import os | ||||
import unittest | |||||
from contextlib import contextmanager | from contextlib import contextmanager | ||||
from typing import TYPE_CHECKING | from typing import TYPE_CHECKING | ||||
@@ -521,11 +520,12 @@ class TestFile(FrappeTestCase): | |||||
assert test_file is not None | assert test_file is not None | ||||
class TestAttachment(unittest.TestCase): | |||||
class TestAttachment(FrappeTestCase): | |||||
test_doctype = "Test For Attachment" | test_doctype = "Test For Attachment" | ||||
@classmethod | @classmethod | ||||
def setUpClass(cls): | def setUpClass(cls): | ||||
super().setUpClass() | |||||
frappe.get_doc( | frappe.get_doc( | ||||
doctype="DocType", | doctype="DocType", | ||||
name=cls.test_doctype, | name=cls.test_doctype, | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestInstalledApplications(unittest.TestCase): | |||||
class TestInstalledApplications(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Language') | # test_records = frappe.get_test_records('Language') | ||||
class TestLanguage(unittest.TestCase): | |||||
class TestLanguage(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestLogSettingUser(unittest.TestCase): | |||||
class TestLogSettingUser(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Module Def') | # test_records = frappe.get_test_records('Module Def') | ||||
class TestModuleDef(unittest.TestCase): | |||||
class TestModuleDef(FrappeTestCase): | |||||
pass | pass |
@@ -1,11 +1,10 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestModuleProfile(unittest.TestCase): | |||||
class TestModuleProfile(FrappeTestCase): | |||||
def test_make_new_module_profile(self): | def test_make_new_module_profile(self): | ||||
if not frappe.db.get_value("Module Profile", "_Test Module Profile"): | if not frappe.db.get_value("Module Profile", "_Test Module Profile"): | ||||
frappe.get_doc( | frappe.get_doc( | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestNavbarItem(unittest.TestCase): | |||||
class TestNavbarItem(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestNavbarSettings(unittest.TestCase): | |||||
class TestNavbarSettings(FrappeTestCase): | |||||
pass | pass |
@@ -3,12 +3,12 @@ | |||||
import json | import json | ||||
import os | import os | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestPackage(unittest.TestCase): | |||||
class TestPackage(FrappeTestCase): | |||||
def test_package_release(self): | def test_package_release(self): | ||||
make_test_package() | make_test_package() | ||||
make_test_module() | make_test_module() | ||||
@@ -2,8 +2,8 @@ | |||||
# See license.txt | # See license.txt | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestPackageImport(unittest.TestCase): | |||||
class TestPackageImport(FrappeTestCase): | |||||
pass | pass |
@@ -2,8 +2,8 @@ | |||||
# See license.txt | # See license.txt | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestPackageRelease(unittest.TestCase): | |||||
class TestPackageRelease(FrappeTestCase): | |||||
pass | pass |
@@ -1,13 +1,12 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_records = frappe.get_test_records("Page") | test_records = frappe.get_test_records("Page") | ||||
class TestPage(unittest.TestCase): | |||||
class TestPage(FrappeTestCase): | |||||
def test_naming(self): | def test_naming(self): | ||||
self.assertRaises( | self.assertRaises( | ||||
frappe.NameError, | frappe.NameError, | ||||
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Patch Log') | # test_records = frappe.get_test_records('Patch Log') | ||||
class TestPatchLog(unittest.TestCase): | |||||
class TestPatchLog(FrappeTestCase): | |||||
pass | pass |
@@ -1,12 +1,12 @@ | |||||
# Copyright (c) 2018, Frappe Technologies and Contributors | # Copyright (c) 2018, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import json | import json | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestPreparedReport(unittest.TestCase): | |||||
class TestPreparedReport(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
self.report = frappe.get_doc({"doctype": "Report", "name": "Permitted Documents For User"}) | self.report = frappe.get_doc({"doctype": "Report", "name": "Permitted Documents For User"}) | ||||
self.filters = {"user": "Administrator", "doctype": "Role"} | self.filters = {"user": "Administrator", "doctype": "Role"} | ||||
@@ -1,14 +1,14 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.role.role import get_info_based_on_role | from frappe.core.doctype.role.role import get_info_based_on_role | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_records = frappe.get_test_records("Role") | test_records = frappe.get_test_records("Role") | ||||
class TestUser(unittest.TestCase): | |||||
class TestUser(FrappeTestCase): | |||||
def test_disable_role(self): | def test_disable_role(self): | ||||
frappe.get_doc("User", "test@example.com").add_roles("_Test Role 3") | frappe.get_doc("User", "test@example.com").add_roles("_Test Role 3") | ||||
@@ -1,13 +1,12 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_dependencies = ["Role"] | test_dependencies = ["Role"] | ||||
class TestRoleProfile(unittest.TestCase): | |||||
class TestRoleProfile(FrappeTestCase): | |||||
def test_make_new_role_profile(self): | def test_make_new_role_profile(self): | ||||
frappe.delete_doc_if_exists("Role Profile", "Test 1", force=1) | frappe.delete_doc_if_exists("Role Profile", "Test 1", force=1) | ||||
new_role_profile = frappe.get_doc(dict(doctype="Role Profile", role_profile="Test 1")).insert() | new_role_profile = frappe.get_doc(dict(doctype="Role Profile", role_profile="Test 1")).insert() | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestScheduledJobLog(unittest.TestCase): | |||||
class TestScheduledJobLog(FrappeTestCase): | |||||
pass | pass |
@@ -1,13 +1,12 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.scheduled_job_type.scheduled_job_type import sync_jobs | from frappe.core.doctype.scheduled_job_type.scheduled_job_type import sync_jobs | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import get_datetime | from frappe.utils import get_datetime | ||||
class TestScheduledJobType(unittest.TestCase): | |||||
class TestScheduledJobType(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
frappe.db.rollback() | frappe.db.rollback() | ||||
frappe.db.truncate("Scheduled Job Type") | frappe.db.truncate("Scheduled Job Type") | ||||
@@ -1,10 +1,9 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import requests | import requests | ||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import get_site_url | from frappe.utils import get_site_url | ||||
scripts = [ | scripts = [ | ||||
@@ -86,10 +85,10 @@ frappe.db.add_index("Todo", ["color", "date"]) | |||||
] | ] | ||||
class TestServerScript(unittest.TestCase): | |||||
class TestServerScript(FrappeTestCase): | |||||
@classmethod | @classmethod | ||||
def setUpClass(cls): | def setUpClass(cls): | ||||
frappe.db.commit() | |||||
super().setUpClass() | |||||
frappe.db.truncate("Server Script") | frappe.db.truncate("Server Script") | ||||
frappe.get_doc("User", "Administrator").add_roles("Script Manager") | frappe.get_doc("User", "Administrator").add_roles("Script Manager") | ||||
for script in scripts: | for script in scripts: | ||||
@@ -1,15 +1,14 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.session_default_settings.session_default_settings import ( | from frappe.core.doctype.session_default_settings.session_default_settings import ( | ||||
clear_session_defaults, | clear_session_defaults, | ||||
set_session_default_values, | set_session_default_values, | ||||
) | ) | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestSessionDefaultSettings(unittest.TestCase): | |||||
class TestSessionDefaultSettings(FrappeTestCase): | |||||
def test_set_session_default_settings(self): | def test_set_session_default_settings(self): | ||||
frappe.set_user("Administrator") | frappe.set_user("Administrator") | ||||
settings = frappe.get_single("Session Default Settings") | settings = frappe.get_single("Session Default Settings") | ||||
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestSMSSettings(unittest.TestCase): | |||||
class TestSMSSettings(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestSystemSettings(unittest.TestCase): | |||||
class TestSystemSettings(FrappeTestCase): | |||||
pass | pass |
@@ -1,14 +1,14 @@ | |||||
# Copyright (c) 2018, Frappe Technologies and Contributors | # Copyright (c) 2018, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import hashlib | import hashlib | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_records = [] | test_records = [] | ||||
class TestTransactionLog(unittest.TestCase): | |||||
class TestTransactionLog(FrappeTestCase): | |||||
def test_validate_chaining(self): | def test_validate_chaining(self): | ||||
frappe.get_doc( | frappe.get_doc( | ||||
{ | { | ||||
@@ -1,12 +1,11 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe import _ | from frappe import _ | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestTranslation(unittest.TestCase): | |||||
class TestTranslation(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
frappe.db.delete("Translation") | frappe.db.delete("Translation") | ||||
@@ -2,7 +2,6 @@ | |||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import json | import json | ||||
import time | import time | ||||
import unittest | |||||
from unittest.mock import patch | from unittest.mock import patch | ||||
import frappe | import frappe | ||||
@@ -18,13 +17,14 @@ from frappe.core.doctype.user.user import ( | |||||
from frappe.desk.notifications import extract_mentions | from frappe.desk.notifications import extract_mentions | ||||
from frappe.frappeclient import FrappeClient | from frappe.frappeclient import FrappeClient | ||||
from frappe.model.delete_doc import delete_doc | from frappe.model.delete_doc import delete_doc | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import get_url | from frappe.utils import get_url | ||||
user_module = frappe.core.doctype.user.user | user_module = frappe.core.doctype.user.user | ||||
test_records = frappe.get_test_records("User") | test_records = frappe.get_test_records("User") | ||||
class TestUser(unittest.TestCase): | |||||
class TestUser(FrappeTestCase): | |||||
def tearDown(self): | def tearDown(self): | ||||
# disable password strength test | # disable password strength test | ||||
frappe.db.set_value("System Settings", "System Settings", "enable_password_policy", 0) | frappe.db.set_value("System Settings", "System Settings", "enable_password_policy", 0) | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2021, Frappe Technologies and Contributors | # Copyright (c) 2021, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestUserGroup(unittest.TestCase): | |||||
class TestUserGroup(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2021, Frappe Technologies and Contributors | # Copyright (c) 2021, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestUserGroupMember(unittest.TestCase): | |||||
class TestUserGroupMember(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,5 @@ | |||||
# Copyright (c) 2021, Frappe Technologies and Contributors | # Copyright (c) 2021, Frappe Technologies and Contributors | ||||
# See LICENSE | # See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.doctype.test_doctype import new_doctype | from frappe.core.doctype.doctype.test_doctype import new_doctype | ||||
from frappe.core.doctype.user_permission.user_permission import ( | from frappe.core.doctype.user_permission.user_permission import ( | ||||
@@ -9,10 +7,11 @@ from frappe.core.doctype.user_permission.user_permission import ( | |||||
remove_applicable, | remove_applicable, | ||||
) | ) | ||||
from frappe.permissions import has_user_permission | from frappe.permissions import has_user_permission | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.website.doctype.blog_post.test_blog_post import make_test_blog | from frappe.website.doctype.blog_post.test_blog_post import make_test_blog | ||||
class TestUserPermission(unittest.TestCase): | |||||
class TestUserPermission(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
test_users = ( | test_users = ( | ||||
"test_bulk_creation_update@example.com", | "test_bulk_creation_update@example.com", | ||||
@@ -1,12 +1,11 @@ | |||||
# Copyright (c) 2021, Frappe Technologies and Contributors | # Copyright (c) 2021, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.installer import update_site_config | from frappe.installer import update_site_config | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestUserType(unittest.TestCase): | |||||
class TestUserType(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
create_role() | create_role() | ||||
@@ -1,14 +1,14 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import copy | import copy | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.version.version import get_diff | from frappe.core.doctype.version.version import get_diff | ||||
from frappe.test_runner import make_test_objects | from frappe.test_runner import make_test_objects | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestVersion(unittest.TestCase): | |||||
class TestVersion(FrappeTestCase): | |||||
def test_get_diff(self): | def test_get_diff(self): | ||||
frappe.set_user("Administrator") | frappe.set_user("Administrator") | ||||
test_records = make_test_objects("Event", reset=True) | test_records = make_test_objects("Event", reset=True) | ||||
@@ -1,11 +1,10 @@ | |||||
# Copyright (c) 2018, Frappe Technologies and Contributors | # Copyright (c) 2018, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestViewLog(unittest.TestCase): | |||||
class TestViewLog(FrappeTestCase): | |||||
def tearDown(self): | def tearDown(self): | ||||
frappe.set_user("Administrator") | frappe.set_user("Administrator") | ||||
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Client Script') | # test_records = frappe.get_test_records('Client Script') | ||||
class TestClientScript(unittest.TestCase): | |||||
class TestClientScript(FrappeTestCase): | |||||
pass | pass |
@@ -1,14 +1,13 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_records = frappe.get_test_records("Custom Field") | test_records = frappe.get_test_records("Custom Field") | ||||
class TestCustomField(unittest.TestCase): | |||||
class TestCustomField(FrappeTestCase): | |||||
def test_create_custom_fields(self): | def test_create_custom_fields(self): | ||||
from .custom_field import create_custom_fields | from .custom_field import create_custom_fields | ||||
@@ -2,17 +2,17 @@ | |||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import json | import json | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.doctype.doctype import InvalidFieldNameError | from frappe.core.doctype.doctype.doctype import InvalidFieldNameError | ||||
from frappe.core.doctype.doctype.test_doctype import new_doctype | from frappe.core.doctype.doctype.test_doctype import new_doctype | ||||
from frappe.test_runner import make_test_records_for_doctype | from frappe.test_runner import make_test_records_for_doctype | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_dependencies = ["Custom Field", "Property Setter"] | test_dependencies = ["Custom Field", "Property Setter"] | ||||
class TestCustomizeForm(unittest.TestCase): | |||||
class TestCustomizeForm(FrappeTestCase): | |||||
def insert_custom_field(self): | def insert_custom_field(self): | ||||
frappe.delete_doc_if_exists("Custom Field", "Event-test_custom_field") | frappe.delete_doc_if_exists("Custom Field", "Event-test_custom_field") | ||||
frappe.get_doc( | frappe.get_doc( | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDocTypeLayout(unittest.TestCase): | |||||
class TestDocTypeLayout(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Property Setter') | # test_records = frappe.get_test_records('Property Setter') | ||||
class TestPropertySetter(unittest.TestCase): | |||||
class TestPropertySetter(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestConsoleLog(unittest.TestCase): | |||||
class TestConsoleLog(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDashboard(unittest.TestCase): | |||||
class TestDashboard(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDashboardChartSource(unittest.TestCase): | |||||
class TestDashboardChartSource(FrappeTestCase): | |||||
pass | pass |
@@ -3,17 +3,17 @@ | |||||
"""Use blog post test to test user permissions logic""" | """Use blog post test to test user permissions logic""" | ||||
import json | import json | ||||
import unittest | |||||
import frappe | import frappe | ||||
import frappe.defaults | import frappe.defaults | ||||
from frappe.desk.doctype.event.event import get_events | from frappe.desk.doctype.event.event import get_events | ||||
from frappe.test_runner import make_test_objects | from frappe.test_runner import make_test_objects | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_records = frappe.get_test_records("Event") | test_records = frappe.get_test_records("Event") | ||||
class TestEvent(unittest.TestCase): | |||||
class TestEvent(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
frappe.db.delete("Event") | frappe.db.delete("Event") | ||||
make_test_objects("Event", reset=True) | make_test_objects("Event", reset=True) | ||||
@@ -2,8 +2,8 @@ | |||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestFormTour(unittest.TestCase): | |||||
class TestFormTour(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Kanban Board') | # test_records = frappe.get_test_records('Kanban Board') | ||||
class TestKanbanBoard(unittest.TestCase): | |||||
class TestKanbanBoard(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestListViewSettings(unittest.TestCase): | |||||
class TestListViewSettings(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestModuleOnboarding(unittest.TestCase): | |||||
class TestModuleOnboarding(FrappeTestCase): | |||||
pass | pass |
@@ -1,14 +1,13 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_records = frappe.get_test_records("Note") | test_records = frappe.get_test_records("Note") | ||||
class TestNote(unittest.TestCase): | |||||
class TestNote(FrappeTestCase): | |||||
def insert_note(self): | def insert_note(self): | ||||
frappe.db.delete("Version") | frappe.db.delete("Version") | ||||
frappe.db.delete("Note") | frappe.db.delete("Note") | ||||
@@ -1,13 +1,12 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.user.user import get_system_users | from frappe.core.doctype.user.user import get_system_users | ||||
from frappe.desk.form.assign_to import add as assign_task | from frappe.desk.form.assign_to import add as assign_task | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestNotificationLog(unittest.TestCase): | |||||
class TestNotificationLog(FrappeTestCase): | |||||
def test_assignment(self): | def test_assignment(self): | ||||
todo = get_todo() | todo = get_todo() | ||||
user = get_user() | user = get_user() | ||||
@@ -2,8 +2,8 @@ | |||||
# See license.txt | # See license.txt | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestNotificationSettings(unittest.TestCase): | |||||
class TestNotificationSettings(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestNumberCard(unittest.TestCase): | |||||
class TestNumberCard(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestOnboardingPermission(unittest.TestCase): | |||||
class TestOnboardingPermission(FrappeTestCase): | |||||
pass | pass |
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestOnboardingStep(unittest.TestCase): | |||||
class TestOnboardingStep(FrappeTestCase): | |||||
pass | pass |
@@ -1,11 +1,10 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestSystemConsole(unittest.TestCase): | |||||
class TestSystemConsole(FrappeTestCase): | |||||
def test_system_console(self): | def test_system_console(self): | ||||
system_console = frappe.get_doc("System Console") | system_console = frappe.get_doc("System Console") | ||||
system_console.console = 'log("hello")' | system_console.console = 'log("hello")' | ||||
@@ -1,11 +1,10 @@ | |||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.desk.doctype.tag.tag import add_tag | from frappe.desk.doctype.tag.tag import add_tag | ||||
from frappe.desk.reportview import get_stats | from frappe.desk.reportview import get_stats | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestTag(unittest.TestCase): | |||||
class TestTag(FrappeTestCase): | |||||
def setUp(self) -> None: | def setUp(self) -> None: | ||||
frappe.db.delete("Tag") | frappe.db.delete("Tag") | ||||
frappe.db.sql("UPDATE `tabDocType` set _user_tags=''") | frappe.db.sql("UPDATE `tabDocType` set _user_tags=''") | ||||
@@ -1,8 +1,8 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
# import frappe | # import frappe | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestTagLink(unittest.TestCase): | |||||
class TestTagLink(FrappeTestCase): | |||||
pass | pass |
@@ -1,16 +1,15 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.core.doctype.doctype.doctype import clear_permissions_cache | from frappe.core.doctype.doctype.doctype import clear_permissions_cache | ||||
from frappe.model.db_query import DatabaseQuery | from frappe.model.db_query import DatabaseQuery | ||||
from frappe.permissions import add_permission, reset_perms | from frappe.permissions import add_permission, reset_perms | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_dependencies = ["User"] | test_dependencies = ["User"] | ||||
class TestToDo(unittest.TestCase): | |||||
class TestToDo(FrappeTestCase): | |||||
def test_delete(self): | def test_delete(self): | ||||
todo = frappe.get_doc( | todo = frappe.get_doc( | ||||
dict(doctype="ToDo", description="test todo", assigned_by="Administrator") | dict(doctype="ToDo", description="test todo", assigned_by="Administrator") | ||||
@@ -1,11 +1,10 @@ | |||||
# Copyright (c) 2020, Frappe Technologies and Contributors | # Copyright (c) 2020, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestWorkspace(unittest.TestCase): | |||||
class TestWorkspace(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
create_module("Test Module") | create_module("Test Module") | ||||
@@ -1,13 +1,12 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.desk.form.linked_with import get_linked_docs, get_linked_doctypes | from frappe.desk.form.linked_with import get_linked_docs, get_linked_doctypes | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestForm(unittest.TestCase): | |||||
class TestForm(FrappeTestCase): | |||||
def test_linked_with(self): | def test_linked_with(self): | ||||
results = get_linked_docs("Role", "System Manager", linkinfo=get_linked_doctypes("Role")) | results = get_linked_docs("Role", "System Manager", linkinfo=get_linked_doctypes("Role")) | ||||
self.assertTrue("User" in results) | self.assertTrue("User" in results) | ||||
@@ -15,5 +14,7 @@ class TestForm(unittest.TestCase): | |||||
if __name__ == "__main__": | if __name__ == "__main__": | ||||
import unittest | |||||
frappe.connect() | frappe.connect() | ||||
unittest.main() | unittest.main() |
@@ -1,16 +1,16 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import json | import json | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.tests.utils import FrappeTestCase | |||||
from frappe.utils import add_to_date, get_link_to_form, today | from frappe.utils import add_to_date, get_link_to_form, today | ||||
from frappe.utils.data import is_html | from frappe.utils.data import is_html | ||||
# test_records = frappe.get_test_records('Auto Email Report') | # test_records = frappe.get_test_records('Auto Email Report') | ||||
class TestAutoEmailReport(unittest.TestCase): | |||||
class TestAutoEmailReport(FrappeTestCase): | |||||
def test_auto_email(self): | def test_auto_email(self): | ||||
frappe.delete_doc("Auto Email Report", "Permitted Documents For User") | frappe.delete_doc("Auto Email Report", "Permitted Documents For User") | ||||
@@ -1,6 +1,5 @@ | |||||
# Copyright (c) 2019, Frappe Technologies and Contributors | # Copyright (c) 2019, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from dataclasses import dataclass | from dataclasses import dataclass | ||||
import frappe | import frappe | ||||
@@ -12,9 +11,10 @@ from frappe.desk.like import toggle_like | |||||
from frappe.query_builder import DocType | from frappe.query_builder import DocType | ||||
from frappe.query_builder.functions import Cast_ | from frappe.query_builder.functions import Cast_ | ||||
from frappe.share import add as share | from frappe.share import add as share | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestDocumentFollow(unittest.TestCase): | |||||
class TestDocumentFollow(FrappeTestCase): | |||||
def test_document_follow_version(self): | def test_document_follow_version(self): | ||||
user = get_user() | user = get_user() | ||||
event_doc = get_event() | event_doc = get_event() | ||||
@@ -14,14 +14,16 @@ from frappe.email.doctype.email_account.email_account import notify_unreplied | |||||
from frappe.email.email_body import get_message_id | from frappe.email.email_body import get_message_id | ||||
from frappe.email.receive import Email, InboundMail, SentEmailInInboxError | from frappe.email.receive import Email, InboundMail, SentEmailInInboxError | ||||
from frappe.test_runner import make_test_records | from frappe.test_runner import make_test_records | ||||
from frappe.tests.utils import FrappeTestCase | |||||
make_test_records("User") | make_test_records("User") | ||||
make_test_records("Email Account") | make_test_records("Email Account") | ||||
class TestEmailAccount(unittest.TestCase): | |||||
class TestEmailAccount(FrappeTestCase): | |||||
@classmethod | @classmethod | ||||
def setUpClass(cls): | def setUpClass(cls): | ||||
super().setUpClass() | |||||
email_account = frappe.get_doc("Email Account", "_Test Email Account 1") | email_account = frappe.get_doc("Email Account", "_Test Email Account 1") | ||||
email_account.db_set("enable_incoming", 1) | email_account.db_set("enable_incoming", 1) | ||||
email_account.db_set("enable_auto_reply", 1) | email_account.db_set("enable_auto_reply", 1) | ||||
@@ -362,6 +364,7 @@ class TestEmailAccount(unittest.TestCase): | |||||
self.assertTrue(communication.reference_name) | self.assertTrue(communication.reference_name) | ||||
self.assertTrue(frappe.db.exists(communication.reference_doctype, communication.reference_name)) | self.assertTrue(frappe.db.exists(communication.reference_doctype, communication.reference_name)) | ||||
@unittest.skip("poorly written and flaky") | |||||
def test_append_to_with_imap_folders(self): | def test_append_to_with_imap_folders(self): | ||||
mail_content_1 = self.get_test_mail(fname="incoming-1.raw") | mail_content_1 = self.get_test_mail(fname="incoming-1.raw") | ||||
mail_content_2 = self.get_test_mail(fname="incoming-2.raw") | mail_content_2 = self.get_test_mail(fname="incoming-2.raw") | ||||
@@ -434,9 +437,10 @@ class TestEmailAccount(unittest.TestCase): | |||||
email_account.receive() | email_account.receive() | ||||
class TestInboundMail(unittest.TestCase): | |||||
class TestInboundMail(FrappeTestCase): | |||||
@classmethod | @classmethod | ||||
def setUpClass(cls): | def setUpClass(cls): | ||||
super().setUpClass() | |||||
email_account = frappe.get_doc("Email Account", "_Test Email Account 1") | email_account = frappe.get_doc("Email Account", "_Test Email Account 1") | ||||
email_account.db_set("enable_incoming", 1) | email_account.db_set("enable_incoming", 1) | ||||
@@ -1,14 +1,13 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe.test_runner import make_test_objects | from frappe.test_runner import make_test_objects | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_records = frappe.get_test_records("Email Domain") | test_records = frappe.get_test_records("Email Domain") | ||||
class TestDomain(unittest.TestCase): | |||||
class TestDomain(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
make_test_objects("Email Domain", reset=True) | make_test_objects("Email Domain", reset=True) | ||||
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Email Flag Queue') | # test_records = frappe.get_test_records('Email Flag Queue') | ||||
class TestEmailFlagQueue(unittest.TestCase): | |||||
class TestEmailFlagQueue(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Email Group') | # test_records = frappe.get_test_records('Email Group') | ||||
class TestEmailGroup(unittest.TestCase): | |||||
class TestEmailGroup(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies and Contributors | # Copyright (c) 2015, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Email Group Member') | # test_records = frappe.get_test_records('Email Group Member') | ||||
class TestEmailGroupMember(unittest.TestCase): | |||||
class TestEmailGroupMember(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2017, Frappe Technologies and Contributors | # Copyright (c) 2017, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestEmailRule(unittest.TestCase): | |||||
class TestEmailRule(FrappeTestCase): | |||||
pass | pass |
@@ -1,7 +1,7 @@ | |||||
# Copyright (c) 2018, Frappe Technologies and Contributors | # Copyright (c) 2018, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestEmailTemplate(unittest.TestCase): | |||||
class TestEmailTemplate(FrappeTestCase): | |||||
pass | pass |
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Email Unsubscribe') | # test_records = frappe.get_test_records('Email Unsubscribe') | ||||
class TestEmailUnsubscribe(unittest.TestCase): | |||||
class TestEmailUnsubscribe(FrappeTestCase): | |||||
pass | pass |
@@ -283,7 +283,6 @@ def subscribe(email, email_group=_("Website")): # noqa | |||||
email, | email, | ||||
subject=email_subject, | subject=email_subject, | ||||
content=content, | content=content, | ||||
now=True, | |||||
) | ) | ||||
@@ -1,12 +1,13 @@ | |||||
# Copyright (c) 2018, Frappe Technologies and Contributors | # Copyright (c) 2018, Frappe Technologies and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from contextlib import contextmanager | from contextlib import contextmanager | ||||
import frappe | import frappe | ||||
import frappe.utils | import frappe.utils | ||||
import frappe.utils.scheduler | import frappe.utils.scheduler | ||||
from frappe.desk.form import assign_to | from frappe.desk.form import assign_to | ||||
from frappe.tests.utils import FrappeTestCase | |||||
test_dependencies = ["User", "Notification"] | test_dependencies = ["User", "Notification"] | ||||
@@ -20,7 +21,7 @@ def get_test_notification(config): | |||||
notification.delete() | notification.delete() | ||||
class TestNotification(unittest.TestCase): | |||||
class TestNotification(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
frappe.db.delete("Email Queue") | frappe.db.delete("Email Queue") | ||||
frappe.set_user("test@example.com") | frappe.set_user("test@example.com") | ||||
@@ -1,9 +1,9 @@ | |||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors | ||||
# License: MIT. See LICENSE | # License: MIT. See LICENSE | ||||
import unittest | |||||
from frappe.tests.utils import FrappeTestCase | |||||
# test_records = frappe.get_test_records('Unhandled Emails') | # test_records = frappe.get_test_records('Unhandled Emails') | ||||
class TestUnhandledEmail(unittest.TestCase): | |||||
class TestUnhandledEmail(FrappeTestCase): | |||||
pass | pass |
@@ -3,7 +3,6 @@ | |||||
import base64 | import base64 | ||||
import os | import os | ||||
import unittest | |||||
import frappe | import frappe | ||||
from frappe import safe_decode | from frappe import safe_decode | ||||
@@ -15,9 +14,10 @@ from frappe.email.email_body import ( | |||||
replace_filename_with_cid, | replace_filename_with_cid, | ||||
) | ) | ||||
from frappe.email.receive import Email | from frappe.email.receive import Email | ||||
from frappe.tests.utils import FrappeTestCase | |||||
class TestEmailBody(unittest.TestCase): | |||||
class TestEmailBody(FrappeTestCase): | |||||
def setUp(self): | def setUp(self): | ||||
email_html = """ | email_html = """ | ||||
<div> | <div> | ||||