Quote: test unauthenticated DB 'add'

This commit is contained in:
James Lu 2015-06-28 11:24:42 -07:00
parent 24c1caac43
commit 1fe663ddb2
1 changed files with 12 additions and 0 deletions

View File

@ -40,4 +40,16 @@ class QuoteTestCase(ChannelPluginTestCase):
self.assertRegexp("quote get 1", "goodbye")
self.assertError("quote replace 5 afsdafas") # non-existant
def testUnauthenticatedAdd(self):
# This should fail because the user isn't registered
self.assertError('quote add hello world!')
original_value = conf.supybot.databases.plugins.requireRegistration()
conf.supybot.databases.plugins.requireRegistration.setValue(False)
try:
self.assertNotError('quote add hello world!')
self.assertRegexp('quote get 1', 'hello')
self.assertNotError('quote remove 1')
finally:
conf.supybot.databases.plugins.requireRegistration.setValue(original_value)
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: