comparison test/test_mailgw.py @ 2710:d694b408a8bc

testNewUserAuthor: "Email Registration" permission... ...changed to "Create" permission on class "user"; remove meaningless hasPermission call
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Wed, 29 Sep 2004 09:34:26 +0000
parents 6b5c77c03231
children f0b887a5e47b
comparison
equal deleted inserted replaced
2709:6b5c77c03231 2710:d694b408a8bc
6 # 6 #
7 # This module is distributed in the hope that it will be useful, 7 # This module is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of 8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 # 10 #
11 # $Id: test_mailgw.py,v 1.71 2004-09-29 09:17:57 a1s Exp $ 11 # $Id: test_mailgw.py,v 1.72 2004-09-29 09:34:26 a1s Exp $
12 12
13 # TODO: test bcc 13 # TODO: test bcc
14 14
15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822 15 import unittest, tempfile, os, shutil, errno, imp, sys, difflib, rfc822
16 16
674 # heh... just ignore the API for a second ;) 674 # heh... just ignore the API for a second ;)
675 self.db.security.role['anonymous'].permissions=[] 675 self.db.security.role['anonymous'].permissions=[]
676 anonid = self.db.user.lookup('anonymous') 676 anonid = self.db.user.lookup('anonymous')
677 self.db.user.set(anonid, roles='Anonymous') 677 self.db.user.set(anonid, roles='Anonymous')
678 678
679 self.db.security.hasPermission('Email Registration', anonid)
680 l = self.db.user.list() 679 l = self.db.user.list()
681 l.sort() 680 l.sort()
682 message = '''Content-Type: text/plain; 681 message = '''Content-Type: text/plain;
683 charset="iso-8859-1" 682 charset="iso-8859-1"
684 From: fubar <fubar@bork.bork.bork> 683 From: fubar <fubar@bork.bork.bork>
692 m = self.db.user.list() 691 m = self.db.user.list()
693 m.sort() 692 m.sort()
694 self.assertEqual(l, m) 693 self.assertEqual(l, m)
695 694
696 # now with the permission 695 # now with the permission
697 p = self.db.security.getPermission('Email Registration') 696 p = self.db.security.getPermission('Create', 'user')
698 self.db.security.role['anonymous'].permissions=[p] 697 self.db.security.role['anonymous'].permissions=[p]
699 self._handle_mail(message) 698 self._handle_mail(message)
700 m = self.db.user.list() 699 m = self.db.user.list()
701 m.sort() 700 m.sort()
702 self.assertNotEqual(l, m) 701 self.assertNotEqual(l, m)

Roundup Issue Tracker: http://roundup-tracker.org/