fireblog.tests package

Submodules

fireblog.tests.comments_test module

class fireblog.tests.comments_test.Test_comment_add[source]

Bases: object

test_anon_recaptcha_fail(pyramid_config, pyramid_req)[source]
test_anon_recaptcha_fail_due_to_exc(pyramid_config, pyramid_req)[source]
test_anon_success(pyramid_config, pyramid_req)[source]
test_logged_in_fail(params, pyramid_config, pyramid_req)[source]
test_logged_in_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.comments_test.Test_comment_delete[source]

Bases: object

test_fail_missing_params(params, pyramid_config, pyramid_req)[source]
test_fail_wrong_comment_uuid(pyramid_config, pyramid_req)[source]
test_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.comments_test.Test_comment_view[source]

Bases: object

static get_comment_list(postname, pyramid_req)[source]
test_success(pyramid_config, pyramid_req)[source]

fireblog.tests.conftest module

fireblog.tests.conftest.clear_dogpile_region()[source]
fireblog.tests.conftest.mydb(request, persona_test_admin_login, theme)[source]
fireblog.tests.conftest.persona_test_admin_login()[source]
fireblog.tests.conftest.pyramid_config(mydb, request)[source]
fireblog.tests.conftest.pyramid_req()[source]
fireblog.tests.conftest.setup_testapp(mydb, request)[source]
fireblog.tests.conftest.test_with_one_theme(theme)[source]
fireblog.tests.conftest.testapp(request, mydb, setup_testapp)[source]
fireblog.tests.conftest.theme(request)[source]

fireblog.tests.functional_tests module

class fireblog.tests.functional_tests.Test_functional_tests[source]

Bases: object

get_csrf_token(testapp)[source]
logged_in(testapp, persona_test_admin_login)[source]

This is a context manager that provides a logged in session as admin. Use as follows:

with logged_in(testapp):
# Do stuff whilst logged in. pass
login(testapp, persona_test_admin_login)[source]
logout(testapp)[source]
test_can_access_add_pages_after_logging_in(testapp, persona_test_admin_login)[source]
test_can_access_del_pages_after_logging_in(testapp, persona_test_admin_login)[source]
test_can_access_edit_pages_after_logging_in(testapp, persona_test_admin_login)[source]
test_can_access_rss_feed_without_logging_in(testapp)[source]
test_cant_access_admin_pages_with_no_login(testapp, url)[source]
test_crud(theme, testapp, persona_test_admin_login)[source]

Testing all CRUD operations in one big test.

test_get_all_page(testapp, sort_order)[source]
test_get_page(testapp)[source]
test_get_tag_view_page(testapp, sort_order)[source]
test_homepage(testapp)[source]
test_login(testapp, persona_test_admin_login)[source]
test_logout(testapp)[source]
test_logout_changes_page_back_to_page_before_logging_in(testapp, persona_test_admin_login)[source]

This test covers a bug I introduced at one point when the view_post page was fully cached, after template rendering. This meant that the page would always be retrieved from cache, not taking into account things like logging in which means that person needs to see a different page.

test_settings_page_includes_all_settings(testapp, theme, persona_test_admin_login)[source]

fireblog.tests.login_test module

class fireblog.tests.login_test.Test_groupfinder[source]

Bases: object

test_failure(pyramid_config)[source]
test_success(persona_test_admin_login, pyramid_config)[source]

fireblog.tests.models_test module

class fireblog.tests.models_test.Test_create_username[source]

Bases: object

test_func_called_with_bad_context()[source]
test_func_called_with_existing_userid(pyramid_config)[source]
test_func_called_with_non_email_address()[source]
test_func_called_with_valid_unique_userid(pyramid_config)[source]

fireblog.tests.renderer_globals_test module

class fireblog.tests.renderer_globals_test.Test_getusername[source]

Bases: object

test_failure(pyramid_config)[source]
test_success(pyramid_config, email, username)[source]

fireblog.tests.tags_test module

class fireblog.tests.tags_test.Test_tag_manager[source]

Bases: object

test_POST_success(pyramid_config, pyramid_req)[source]

Test deleting tag1 and renaming tag2 and not changing tag3.

test_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.tags_test.Test_tag_view[source]

Bases: object

test_failure(pyramid_config, pyramid_req)[source]
test_long_posts_get_truncated(body, html, mydb, pyramid_config, pyramid_req)[source]
test_success(tag, actual_posts, pyramid_config, pyramid_req)[source]

Test that the right posts are displayed and that they are in the right order by default (newest first).

test_success_sort_oldest_first(pyramid_config, pyramid_req)[source]

Test that posts can be sorted oldest first

fireblog.tests.tasks_test module

fireblog.tests.tasks_test.test_reload_func_calls_uwsgi_reload_func(_, uwsgi_mock, tmpdir)[source]
fireblog.tests.tasks_test.test_reload_func_doesnt_remove_folders_in_spooler_dir(_, __, tmpdir)[source]
fireblog.tests.tasks_test.test_reload_func_removes_all_files_in_spooler_dir(_, __, tmpdir)[source]
fireblog.tests.tasks_test.test_reload_func_sleeps_for_one_second(sleep_mock, __, tmpdir)[source]

fireblog.tests.views_test module

class fireblog.tests.views_test.Test_add_post[source]

Bases: object

static submit_add_post(request, postname, body, tags)[source]
test_GET_failure(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_GET_success(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_POST_failure(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_POST_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.views_test.Test_del_post[source]

Bases: object

test_GET_failure(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_GET_success(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_POST_failure(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_POST_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.views_test.Test_edit_post[source]

Bases: object

test_GET_failure(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_GET_success(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_POST_failure(pyramid_config, pyramid_req, test_with_one_theme)[source]
test_POST_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.views_test.Test_home[source]

Bases: object

test_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.views_test.Test_rss[source]

Bases: object

pytestmark = [<MarkDecorator 'usefixtures' {'args': ('test_with_one_theme',), 'kwargs': {}}>]
rss_success_text_1 = ''

<?xml version=”1.0” encoding=”iso-8859-1”?> <rss version=”2.0”><channel>

rss_success_text_2 = ''

</lastBuildDate><generator>PyRSS2Gen-1.1.0</generator><docs>

test_success(pyramid_config, pyramid_req)[source]
class fireblog.tests.views_test.Test_uuid[source]

Bases: object

pytestmark = [<MarkDecorator 'usefixtures' {'args': ('test_with_one_theme',), 'kwargs': {}}>]
test_multiple_results(uuid, pyramid_config, pyramid_req)[source]
test_no_results(uuid, pyramid_config, pyramid_req)[source]
test_post_success(uuid, location, pyramid_config, pyramid_req)[source]
test_tag_success(uuid, location, pyramid_config, pyramid_req)[source]
class fireblog.tests.views_test.Test_view_all_posts[source]

Bases: object

pytestmark = [<MarkDecorator 'usefixtures' {'args': ('test_with_one_theme',), 'kwargs': {}}>]
test_long_posts_get_truncated(body, html, mydb, pyramid_config, pyramid_req)[source]
test_success(pyramid_config, pyramid_req)[source]
test_success_sort_oldest_first(pyramid_config, pyramid_req)[source]
test_success_with_pygments_code_css_included(pyramid_config, pyramid_req)[source]
class fireblog.tests.views_test.Test_view_multiple_posts_pager[source]

Bases: object

Test the pager functionality on both view_all_posts and tag_view views

classmethod check_posts_list_is_correct(posts, page_num, sort_ascending=False, tag_view=False)[source]
create_many_posts(mydb, pyramid_config, pyramid_req)[source]
extra_posts_created = 101
max_pagination_page = 6
max_tag_view_pagination_page = 6
pytestmark = [<MarkDecorator 'usefixtures' {'args': ('test_with_one_theme',), 'kwargs': {}}>]
test_all_posts_success_first_page(create_many_posts, pyramid_req)[source]
test_all_posts_success_second_page(create_many_posts, pyramid_req)[source]
test_all_posts_success_second_page_oldest_first(create_many_posts, pyramid_req)[source]
test_tag_view_success_first_page(create_many_posts, pyramid_req)[source]
test_tag_view_success_second_page(create_many_posts, pyramid_req)[source]
test_tag_view_success_second_page_oldest_first(create_many_posts, pyramid_req)[source]
total_posts = 103
class fireblog.tests.views_test.Test_view_post[source]

Bases: object

test_failure(pyramid_config, pyramid_req)[source]
test_success(pyramid_config, pyramid_req)[source]

Module contents