Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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)
Esempio n. 4
0
 def setUp(self):
     super(ResellerTestCase, self).setUp()
     self.user = UserFactory.create(
         username='******', groups=('Resellers',)
     )
     self.clt.logout()
     self.clt.login(username='******', password='******')
Esempio n. 5
0
 def setUp(self):
     super(ResellerTestCase, self).setUp()
     self.user = UserFactory.create(
         username='******', groups=('Resellers',)
     )
     self.clt.logout()
     self.clt.login(username='******', password='******')
Esempio n. 6
0
    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="******")
Esempio n. 7
0
 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", ))
Esempio n. 8
0
 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', ))
Esempio n. 9
0
    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', ))
Esempio n. 10
0
 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',)
     )
Esempio n. 11
0
    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='******')
Esempio n. 12
0
 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",)
     )
Esempio n. 13
0
    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', ))
Esempio n. 14
0
    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',)
        )
Esempio n. 15
0
    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',)
        )
Esempio n. 16
0
    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='******')
Esempio n. 17
0
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)
Esempio n. 18
0
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)
Esempio n. 19
0
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)
Esempio n. 20
0
    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='******')
Esempio n. 21
0
 def setUpTestData(cls):
     """Create test data."""
     super(ResellerTestCase, cls).setUpTestData()
     cls.user = UserFactory.create(
         username='******', groups=('Resellers',)
     )
Esempio n. 22
0
 def setUpTestData(cls):
     """Create test data."""
     super(ResellerTestCase, cls).setUpTestData()
     cls.user = UserFactory.create(username='******',
                                   groups=('Resellers', ))