def populate_database(): """Create test data. 2 domains, 1 domain admin, 2 users """ dom = DomainFactory(name="test.com") admin = UserFactory(username="******", groups=('DomainAdmins', ), password='******') MailboxFactory(address='admin', domain=dom, user=admin) account = UserFactory.create( username="******", groups=('SimpleUsers', ), ) MailboxFactory.create(address='user', domain=dom, user=account) fwd = AliasFactory.create(address='forward', domain=dom, extmboxes='*****@*****.**') al = AliasFactory.create(address='alias', domain=dom) al.mboxes.add(account.mailbox_set.all()[0]) AliasFactory.create(address='postmaster', domain=dom, extmboxes='[email protected],[email protected]') dom.add_admin(admin) dom2 = DomainFactory.create(name='test2.com', quota=0) admin = UserFactory.create(username='******', groups=('DomainAdmins', ), password='******') MailboxFactory.create(address='admin', domain=dom2, user=admin) u = UserFactory.create(username='******', groups=('SimpleUsers', )) MailboxFactory.create(address='user', domain=dom2, user=u) dom2.add_admin(admin)
def populate_database(): """Create test data. 2 domains, 1 domain admin, 2 users """ dom = DomainFactory(name="test.com", quota=50) admin = UserFactory( username="******", groups=("DomainAdmins", ), password="******" ) MailboxFactory(address="admin", domain=dom, user=admin) account = UserFactory.create( username="******", groups=("SimpleUsers",), ) MailboxFactory.create(address="user", domain=dom, user=account) al = AliasFactory.create( address="*****@*****.**", domain=dom ) AliasRecipientFactory.create( address="*****@*****.**", alias=al) al = AliasFactory.create( address="*****@*****.**", domain=dom ) mb = account.mailbox AliasRecipientFactory.create( address=mb.full_address, alias=al, r_mailbox=mb) al = AliasFactory.create( address="*****@*****.**", domain=dom ) for address in ["*****@*****.**", "*****@*****.**"]: AliasRecipientFactory.create(address=address, alias=al) dom.add_admin(admin) dom2 = DomainFactory.create(name="test2.com", default_mailbox_quota=0) admin = UserFactory.create( username="******", groups=("DomainAdmins",), password="******" ) MailboxFactory.create(address="admin", domain=dom2, user=admin) u = UserFactory.create( username="******", groups=("SimpleUsers",) ) MailboxFactory.create(address="user", domain=dom2, user=u) dom2.add_admin(admin)
def populate_database(): """Create test data. 2 domains, 1 domain admin, 2 users """ dom = DomainFactory(name="test.com", quota=50) admin = UserFactory( username="******", groups=('DomainAdmins', ), password='******' ) MailboxFactory(address='admin', domain=dom, user=admin) account = UserFactory.create( username="******", groups=('SimpleUsers',), ) MailboxFactory.create(address='user', domain=dom, user=account) al = AliasFactory.create( address='*****@*****.**', domain=dom ) AliasRecipientFactory.create( address='*****@*****.**', alias=al) al = AliasFactory.create( address='*****@*****.**', domain=dom ) mb = account.mailbox AliasRecipientFactory.create( address=mb.full_address, alias=al, r_mailbox=mb) al = AliasFactory.create( address='*****@*****.**', domain=dom ) for address in ['*****@*****.**', '*****@*****.**']: AliasRecipientFactory.create(address=address, alias=al) dom.add_admin(admin) dom2 = DomainFactory.create(name='test2.com', default_mailbox_quota=0) admin = UserFactory.create( username='******', groups=('DomainAdmins',), password='******' ) MailboxFactory.create(address='admin', domain=dom2, user=admin) u = UserFactory.create( username='******', groups=('SimpleUsers',) ) MailboxFactory.create(address='user', domain=dom2, user=u) dom2.add_admin(admin)
def setUp(self): super(ResellerTestCase, self).setUp() self.user = UserFactory.create( username='******', groups=('Resellers',) ) self.clt.logout() self.clt.login(username='******', password='******')
def setUp(self): super(LimitsTestCase, self).setUp() for tpl in LimitTemplates().templates: parameters.save_admin("DEFLT_{0}".format(tpl[0].upper()), 2, app="limits") self.user = UserFactory.create(username="******", groups=("Resellers",)) self.clt.logout() self.clt.login(username="******", password="******")
def setUpTestData(cls): # NOQA:N802 """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for name, _definition in limits_utils.get_user_limit_templates(): cls.localconfig.parameters.set_value( "deflt_user_{0}_limit".format(name), 2, app="limits") cls.localconfig.save() cls.user = UserFactory.create(username="******", groups=("Resellers", ))
def setUpTestData(cls): """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for name, tpl in limits_utils.get_user_limit_templates(): cls.localconfig.parameters.set_value( "deflt_user_{0}_limit".format(name), 2, app="limits") cls.localconfig.save() cls.user = UserFactory.create(username='******', groups=('Resellers', ))
def setUpTestData(cls): """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for name, tpl in limits_utils.get_limit_templates(): parameters.save_admin("DEFLT_{0}_LIMIT".format(name.upper()), 2, app="limits") cls.user = UserFactory.create(username='******', groups=('Resellers', ))
def setUpTestData(cls): """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for name, tpl in limits_utils.get_user_limit_templates(): cls.localconfig.parameters.set_value( "deflt_user_{0}_limit".format(name), 2, app="limits") cls.localconfig.save() cls.user = UserFactory.create( username='******', groups=('Resellers',) )
def setUp(self): super(LimitsTestCase, self).setUp() from modoboa.extensions.limits.models import LimitTemplates for tpl in LimitTemplates().templates: parameters.save_admin('DEFLT_%s' % tpl[0].upper(), 2, app='limits') self.user = UserFactory.create(username='******', groups=('Resellers', )) self.clt.logout() self.clt.login(username='******', password='******')
def setUpTestData(cls): # NOQA:N802 """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for name, _definition in limits_utils.get_user_limit_templates(): cls.localconfig.parameters.set_value( "deflt_user_{0}_limit".format(name), 2, app="limits") cls.localconfig.save() cls.user = UserFactory.create( username="******", groups=("Resellers",) )
def setUpTestData(cls): """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for tpl in LimitTemplates().templates: parameters.save_admin("DEFLT_{0}".format(tpl[0].upper()), 2, app="limits") cls.user = UserFactory.create(username='******', groups=('Resellers', ))
def setUpTestData(cls): """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for tpl in LimitTemplates().templates: parameters.save_admin( "DEFLT_{0}".format(tpl[0].upper()), 2, app="limits" ) cls.user = UserFactory.create( username='******', groups=('Resellers',) )
def setUpTestData(cls): """Create test data.""" super(LimitsTestCase, cls).setUpTestData() for name, tpl in limits_utils.get_limit_templates(): parameters.save_admin( "DEFLT_{0}_LIMIT".format(name.upper()), 2, app="limits" ) cls.user = UserFactory.create( username='******', groups=('Resellers',) )
def setUp(self): super(LimitsTestCase, self).setUp() from modoboa.extensions.limits.models import LimitTemplates for tpl in LimitTemplates().templates: parameters.save_admin('DEFLT_%s' % tpl[0].upper(), 2, app='limits') self.user = UserFactory.create( username='******', groups=('Resellers',) ) self.clt.logout() self.clt.login(username='******', password='******')
def populate_database(): """Create test data. 2 domains, 1 domain admin, 2 users """ dom = DomainFactory(name="test.com") admin = UserFactory(username="******", groups=('DomainAdmins', ), password='******') MailboxFactory(address='admin', domain=dom, user=admin) account = UserFactory.create( username="******", groups=('SimpleUsers', ), ) MailboxFactory.create(address='user', domain=dom, user=account) al = AliasFactory.create(address='*****@*****.**', domain=dom) AliasRecipientFactory.create(address='*****@*****.**', alias=al) al = AliasFactory.create(address='*****@*****.**', domain=dom) mb = account.mailbox AliasRecipientFactory.create(address=mb.full_address, alias=al, r_mailbox=mb) al = AliasFactory.create(address='*****@*****.**', domain=dom) for address in ['*****@*****.**', '*****@*****.**']: AliasRecipientFactory.create(address=address, alias=al) dom.add_admin(admin) dom2 = DomainFactory.create(name='test2.com', quota=0) admin = UserFactory.create(username='******', groups=('DomainAdmins', ), password='******') MailboxFactory.create(address='admin', domain=dom2, user=admin) u = UserFactory.create(username='******', groups=('SimpleUsers', )) MailboxFactory.create(address='user', domain=dom2, user=u) dom2.add_admin(admin)
def populate_database(): """Create test data. 2 domains, 1 domain admin, 2 users """ dom = DomainFactory(name="test.com") admin = UserFactory( username="******", groups=('DomainAdmins', ), password='******' ) MailboxFactory(address='admin', domain=dom, user=admin) account = UserFactory.create( username="******", groups=('SimpleUsers',), ) MailboxFactory.create(address='user', domain=dom, user=account) fwd = AliasFactory.create( address='forward', domain=dom, extmboxes='*****@*****.**' ) al = AliasFactory.create( address='alias', domain=dom ) al.mboxes.add(account.mailbox_set.all()[0]) AliasFactory.create( address='postmaster', domain=dom, extmboxes='[email protected],[email protected]' ) dom.add_admin(admin) dom2 = DomainFactory.create(name='test2.com', quota=0) admin = UserFactory.create( username='******', groups=('DomainAdmins',), password='******' ) MailboxFactory.create(address='admin', domain=dom2, user=admin) u = UserFactory.create( username='******', groups=('SimpleUsers',) ) MailboxFactory.create(address='user', domain=dom2, user=u) dom2.add_admin(admin)
def populate_database(): """Create test data. 2 domains, 1 domain admin, 2 users """ dom = DomainFactory.create(name="test.com") admin = UserFactory(username="******", groups=("DomainAdmins",), password="******") MailboxFactory(address="admin", domain=dom, user=admin) account = UserFactory.create(username="******", groups=("SimpleUsers",)) MailboxFactory.create(address="user", domain=dom, user=account) fwd = AliasFactory.create(address="forward", domain=dom, extmboxes="*****@*****.**") al = AliasFactory.create(address="alias", domain=dom) al.mboxes.add(account.mailbox_set.all()[0]) AliasFactory.create(address="postmaster", domain=dom, extmboxes="[email protected],[email protected]") dom.add_admin(admin) dom2 = DomainFactory.create(name="test2.com", quota=0) admin = UserFactory.create(username="******", groups=("DomainAdmins",), password="******") MailboxFactory.create(address="admin", domain=dom2, user=admin) u = UserFactory.create(username="******", groups=("SimpleUsers",)) MailboxFactory.create(address="user", domain=dom2, user=u) dom2.add_admin(admin)
def setUp(self): super(LimitsTestCase, self).setUp() from modoboa_admin_limits.models import LimitTemplates for tpl in LimitTemplates().templates: parameters.save_admin( "DEFLT_{0}".format(tpl[0].upper()), 2, app="modoboa_admin_limits" ) self.user = UserFactory.create( username='******', groups=('Resellers',) ) self.clt.logout() self.clt.login(username='******', password='******')
def setUpTestData(cls): """Create test data.""" super(ResellerTestCase, cls).setUpTestData() cls.user = UserFactory.create( username='******', groups=('Resellers',) )
def setUpTestData(cls): """Create test data.""" super(ResellerTestCase, cls).setUpTestData() cls.user = UserFactory.create(username='******', groups=('Resellers', ))