mirror of
				https://github.com/Mikaela/Limnoria.git
				synced 2025-11-03 17:17:23 +01:00 
			
		
		
		
	Quote: test unauthenticated DB 'add'
This commit is contained in:
		
							parent
							
								
									24c1caac43
								
							
						
					
					
						commit
						1fe663ddb2
					
				@ -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:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user