timApp.tests.db package#

Submodules#

timApp.tests.db.test_clipboard module#

Unit tests for Clipboard class.

class timApp.tests.db.test_clipboard.ClipboardTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

setUp()[source]#

Hook method for setting up the test fixture before exercising it.

test_copy()[source]#
test_empty()[source]#
test_paste()[source]#
test_persistence()[source]#
timApp.tests.db.test_clipboard.test_paste_ref(self)[source]#

timApp.tests.db.test_contacts module#

class timApp.tests.db.test_contacts.ContactsTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

Tests for adding and manipulating contacts

test_email_contacts_set()[source]#

Test various common cases for adding and changing email contacts

test_new_user_emails()[source]#

Test that new users get contacts correctly created

timApp.tests.db.test_document module#

Unit tests for Document class.

class timApp.tests.db.test_document.DocumentTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

add_pars(d, num_docs)[source]#
test_addparagraph()[source]#
test_clear_document()[source]#
test_delparagraph()[source]#
test_document_create()[source]#
test_get_html()[source]#
test_import()[source]#
test_insertparagraph()[source]#
test_iterator()[source]#
test_macro_expansion_from_reference()[source]#
test_macros()[source]#
test_modify()[source]#
test_parwise_diff()[source]#
test_parwise_diff_html()[source]#
test_predefined_macros()[source]#
test_settings_block_style()[source]#

Settings paragraph is always serialized in the block style.

test_settings_cached()[source]#
test_unsync_work()[source]#
test_update()[source]#
test_update_section()[source]#

timApp.tests.db.test_folder_rename module#

class timApp.tests.db.test_folder_rename.FolderRenameTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_folder_rename()[source]#

timApp.tests.db.test_import_accounts module#

class timApp.tests.db.test_import_accounts.AccountImportTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_email_and_name_missing()[source]#
test_email_existing()[source]#
test_import_accounts()[source]#
test_import_existing_no_name()[source]#
test_import_lowercase()[source]#
test_import_no_password()[source]#
test_invalid_email()[source]#
test_no_email()[source]#
write_and_test(accounts: list[timApp.user.user.UserInfo], username_is_email=False, expected_existing=None)[source]#
write_test_csv(accounts, include_username=True)[source]#

timApp.tests.db.test_import_passwords module#

class timApp.tests.db.test_import_passwords.PasswordImportTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_import_passwords()[source]#

timApp.tests.db.test_item_create module#

class timApp.tests.db.test_item_create.ItemCreateTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_no_document_subitem()[source]#

Tests that items cannot be created under documents and that an item cannot be created at the same path as some existing item.

timApp.tests.db.test_markdownconverter module#

A test for markdownconverter module.

class timApp.tests.db.test_markdownconverter.MarkdownConverterTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

check_conversion(html, md, macros=None)[source]#
test_bracketed_spans()[source]#
test_invalid_inputformat()[source]#
test_markdown()[source]#
test_markdown_sanitize_neutral()[source]#
test_markup_md_conversion()[source]#
test_rst()[source]#
test_smart_punct()[source]#
test_unsafe_not_allowed()[source]#

timApp.tests.db.test_notify module#

class timApp.tests.db.test_notify.NotifyTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_notify()[source]#

timApp.tests.db.test_personal_folder module#

class timApp.tests.db.test_personal_folder.PersonalFolderTest(methodName='runTest')[source]#

Bases: timApp.tests.server.timroutetest.TimRouteTest

test_anon_personal_folder()[source]#

Make sure personal folders aren’t created for each anonymous request.

test_no_multiple_personal_folders()[source]#
test_personal_folder_name()[source]#

timApp.tests.db.test_plugin module#

class timApp.tests.db.test_plugin.PluginTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_info()[source]#

timApp.tests.db.test_references module#

Unit tests for testing paragraph referencing.

class timApp.tests.db.test_references.RefTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

assert_dict_issubset(a, b)[source]#
dict_issubset(a, b)[source]#
dict_merge(a, b)[source]#
init_testdb()[source]#
setUp()[source]#

Hook method for setting up the test fixture before exercising it.

test_circular()[source]#
test_editparagraph_cite()[source]#
test_editparagraph_citearea()[source]#
test_editparagraph_translate()[source]#
test_editparagraph_translatearea()[source]#
test_reference_classes()[source]#

Classes of reference and source paragraphs are merged.

test_settings_not_inherited()[source]#

Settings attribute is not inherited from a referring paragraph.

test_simpleref()[source]#
test_transitive()[source]#
test_translation()[source]#
timApp.tests.db.test_references.add_area_ref_paragraph(doc: timApp.document.document.Document, src_doc: timApp.document.document.Document, src_area_name: str, text: Optional[str] = None, attrs: Optional[dict] = None) timApp.document.docparagraph.DocParagraph[source]#
timApp.tests.db.test_references.add_ref_paragraph(doc: timApp.document.document.Document, src_par: timApp.document.docparagraph.DocParagraph, text: Optional[str] = None, attrs: Optional[dict] = None) timApp.document.docparagraph.DocParagraph[source]#

timApp.tests.db.test_safe_yaml module#

class timApp.tests.db.test_safe_yaml.SafeYamlTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_safe_yaml()[source]#

timApp.tests.db.test_settings module#

class timApp.tests.db.test_settings.SettingsTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

test_invalid_settings()[source]#
test_settings_area_reference()[source]#
test_settings_invalid_area_reference()[source]#
test_settings_multiple()[source]#
test_settings_multiple_reference()[source]#
test_settings_reference()[source]#
timApp.tests.db.test_settings.make_settings(p: timApp.document.docparagraph.DocParagraph)[source]#

timApp.tests.db.test_users module#

class timApp.tests.db.test_users.UserTest(methodName='runTest')[source]#

Bases: timApp.tests.db.timdbtest.TimDbTest

grant(g: timApp.user.usergroup.UserGroup, b: timApp.item.block.Block, t: timApp.auth.accesstype.AccessType, **kwargs)[source]#
remove(g, b: timApp.item.block.Block, t)[source]#
test_create_user()[source]#
test_last_name_switch()[source]#
test_timed_permissions()[source]#

timApp.tests.db.timdbtest module#

class timApp.tests.db.timdbtest.TimDbTest(methodName='runTest')[source]#

Bases: unittest.case.TestCase

assert_contacts(user: timApp.user.user.User, channel: timApp.messaging.messagelist.listinfo.Channel, contacts: list[tuple[timApp.user.usercontact.ContactOrigin, str]])[source]#
assert_dict_subset(data, subset)[source]#
assert_list_of_dicts_subset(datalist, subsetlist)[source]#
assert_primary_contact(user: timApp.user.user.User, channel: timApp.messaging.messagelist.listinfo.Channel, origin: timApp.user.usercontact.ContactOrigin, contact: str)[source]#
create_doc(from_file=None, initial_par: Optional[Union[str, list[str]]] = None, settings=None) timApp.document.docinfo.DocInfo[source]#
create_docs = False#
db_path = 'postgresql://postgres:postgresql@postgresql:5432/tim'#
get_db()[source]#
get_test_user_1_group_id()[source]#
get_test_user_2_group_id()[source]#
i = 0#
init_doc(doc: timApp.document.document.Document, from_file, initial_par: str | list[str], settings)[source]#
setUp()[source]#

Hook method for setting up the test fixture before exercising it.

classmethod setUpClass()[source]#

Hook method for setting up class fixture before running tests in the class.

suppress_stdout()[source]#
tearDown()[source]#

Hook method for deconstructing the test fixture after testing it.

test_files_path = PosixPath('/tmp/doctest_files')#
property test_user_1: timApp.user.user.User#
property test_user_2: timApp.user.user.User#
property test_user_3: timApp.user.user.User#
timApp.tests.db.timdbtest.running_in_gitlab()[source]#

Module contents#