tests.edit_failure_tests module#

Tests for edit failures.

These tests should never write to the wiki, unless something has broken badly.

These tests use special code ‘write = -1’ for edit failures.

class tests.edit_failure_tests.TestActionFailure(*args, **kwargs)[source]#

Bases: RequireLoginMixin, SiteWriteMixin, CheckHostnameMixin, TestCase

Test cases for actions which should fail to save.

abstract_class = False#
code = 'test'#
family = 'wikipedia'#
login = True#
net = True#
site = True#
sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
test_movepage()[source]#

Test that site.movepage raises the appropriate exceptions.

write = -1#
class tests.edit_failure_tests.TestSaveFailure(*args, **kwargs)[source]#

Bases: RequireLoginMixin, SiteWriteMixin, CheckHostnameMixin, TestCase

Test cases for edits which should fail to save.

abstract_class = False#
code = 'test'#
family = 'wikipedia'#
login = True#
net = True#
site = True#
sites = {'wikipedia:test': {'code': 'test', 'family': 'wikipedia'}}#
test_createonly()[source]#

Test that Page.save with createonly fails if page exists.

test_no_recreate()[source]#

Test that Page.save with recreate disabled fails if page existed.

test_nobots()[source]#

Test that {{nobots}} raise the appropriate exception.

test_nocreate()[source]#

Test that Page.save with nocreate fails if page does not exist.

test_protected()[source]#

Test that protected titles raise the appropriate exception.

test_spam()[source]#

Test that spam in content raise the appropriate exception.

test_titleblacklist()[source]#

Test that title blacklist raise the appropriate exception.

test_touch()[source]#

Test that Page.touch() does not do a real edit.

write = -1#
class tests.edit_failure_tests.TestWikibaseSaveTest(*args, **kwargs)[source]#

Bases: RequireLoginMixin, SiteWriteMixin, CheckHostnameMixin, WikibaseTestCase

Test case for WikibasePage.save on Wikidata test site.

abstract_class = False#
code = 'test'#
family = 'wikidata'#
login = True#
net = True#
site = True#
sites = {'wikidata:test': {'code': 'test', 'family': 'wikidata'}}#
test_WbMonolingualText_invalid_language()[source]#

Attempt adding a monolingual text with an invalid language.

test_WbMonolingualText_invalid_text()[source]#

Attempt adding a monolingual text with invalid non-string text.

test_itempage_save()[source]#

Test ItemPage save method inherited from superclass Page.

test_math_invalid_function()[source]#

Attempt adding invalid latex to a math claim.

test_url_invalid_protocol()[source]#

Attempt adding a URL with an invalid protocol to a url claim.

test_url_malformed_url()[source]#

Attempt adding a malformed URL to a url claim.

wikibase = True#
write = -1#