コード例 #1
0
 def setUp(self):
     """
     Setup fixtures before running e2e test.
     """
     super(AuthorizationTestCase, self).setUp()
     call_command('index')
     LilyUserFactory.create(is_active=True, email='*****@*****.**', password=make_password('testing'))
コード例 #2
0
 def setUp(self):
     """
     Setup fixtures before running e2e test.
     """
     super(AuthorizationTestCase, self).setUp()
     call_command("index")
     call_command("testdata", target="contacts_and_accounts,cases,deals,notes")
     LilyUserFactory.create(is_active=True, email="*****@*****.**", password=make_password("testing"))
コード例 #3
0
 def setUp(self):
     """
     Setup fixtures before running e2e test.
     """
     super(AuthorizationTestCase, self).setUp()
     call_command('index')
     LilyUserFactory.create(is_active=True,
                            email='*****@*****.**',
                            password=make_password('testing'))
コード例 #4
0
    def users_login(self, **kwargs):
        kwargs.update({
            'tenant': kwargs.get('tenant', self.tenant),
            'teams': kwargs.get('teams') if kwargs.get('teams') else iterator(self.users_team),
            'is_active': kwargs.get('is_active', True),
            'email': '*****@*****.**' % self.tenant.pk,
        })

        user = LilyUserFactory.create(**kwargs)

        self.stdout.write('\nYou can now login as a normal user in %(tenant)s with:\n%(email)s\n%(password)s\n' % {
            'tenant': self.tenant,
            'email': user.email,
            'password': '******'
        })

        kwargs['email'] = '*****@*****.**' % self.tenant.pk
        superuser = LilySuperUserFactory.create(**kwargs)

        self.stdout.write('\nYou can now login as a superuser in %(tenant)s with:\n%(email)s\n%(password)s\n\n' % {
            'tenant': self.tenant,
            'email': superuser.email,
            'password': '******'
        })

        return [user, superuser]
コード例 #5
0
ファイル: testdata.py プロジェクト: HelloLily/hellolily
    def users_login(self, **kwargs):
        kwargs.update({
            'tenant': kwargs.get('tenant', self.tenant),
            'teams': kwargs.get('teams') if kwargs.get('teams') else iterator(self.users_team),
            'is_active': kwargs.get('is_active', True),
            'email': '*****@*****.**' % self.tenant.pk,
        })

        user = LilyUserFactory.create(**kwargs)

        self.stdout.write('\nYou can now login as a normal user in %(tenant)s with:\n%(email)s\n%(password)s\n' % {
            'tenant': self.tenant,
            'email': user.email,
            'password': '******'
        })

        kwargs['email'] = '*****@*****.**' % self.tenant.pk
        superuser = LilySuperUserFactory.create(**kwargs)

        self.stdout.write('\nYou can now login as a superuser in %(tenant)s with:\n%(email)s\n%(password)s\n\n' % {
            'tenant': self.tenant,
            'email': superuser.email,
            'password': '******'
        })

        return [user, superuser]
コード例 #6
0
ファイル: testdata.py プロジェクト: HelloLily/hellolily
    def users_login(self, **kwargs):
        kwargs.update(
            {
                "tenant": kwargs.get("tenant", self.tenant),
                "teams": kwargs.get("teams") if kwargs.get("teams") else iterator(self.users_team),
                "is_active": kwargs.get("is_active", True),
                "email": "*****@*****.**" % self.tenant.pk,
            }
        )

        user = LilyUserFactory.create(**kwargs)

        self.stdout.write(
            "\nYou can now login as a normal user in %(tenant)s with:\n%(email)s\n%(password)s\n"
            % {"tenant": self.tenant, "email": user.email, "password": "******"}
        )

        kwargs["email"] = "*****@*****.**" % self.tenant.pk
        superuser = LilySuperUserFactory.create(**kwargs)

        self.stdout.write(
            "\nYou can now login as a superuser in %(tenant)s with:\n%(email)s\n%(password)s\n\n"
            % {"tenant": self.tenant, "email": superuser.email, "password": "******"}
        )

        return [user, superuser]
コード例 #7
0
ファイル: testdata.py プロジェクト: noordzij/hellolily
 def users(self, size, tenant):
     LilyUserFactory.create_batch(size, tenant=tenant)
     user = LilyUserFactory.create(tenant=tenant, is_active=True, email='*****@*****.**' % tenant.pk)
     self.stdout.write('You can now login as a normal user in %(tenant)s with:\n%(email)s\n%(password)s\n' % {
         'tenant': tenant,
         'email': user.email,
         'password': '******'
     })
コード例 #8
0
    def setUpClass(cls):
        """
        Creates a user and logs it in before running the account tests.
        """

        # Remove leftovers from previous tests
        LilyUser.objects.all().delete()

        cls.user = LilyUserFactory.create(is_active=True, email='*****@*****.**', password=make_password('test'))

        cls.client = APIClient()
        cls.client.login(email='*****@*****.**', password='******')
コード例 #9
0
ファイル: testdata.py プロジェクト: Vegulla/hellolily
 def users(self, size, tenant):
     LilyUserFactory.create_batch(size, tenant=tenant)
     user = LilyUserFactory.create(tenant=tenant,
                                   is_active=True,
                                   email='*****@*****.**' % tenant.pk)
     self.stdout.write(
         'You can now login as a normal user in %(tenant)s with:\n%(email)s\n%(password)s\n'
         % {
             'tenant': tenant,
             'email': user.email,
             'password': '******'
         })
コード例 #10
0
    def test_contact_closed_deals_cases_account(self):
        """
        Test having a contact attached to a contact with no cases or deals.
        """
        assigned_to_user = LilyUserFactory.create(tenant=self.user_obj.tenant, is_active=True)
        account = AccountFactory.create(tenant=self.user_obj.tenant, assigned_to=assigned_to_user)
        Function.objects.create(account=account, contact=self.contact)

        # Make api call.
        response = self.user.get(reverse(self.search_url, kwargs={'number': self.phone_number.number}))

        # Verify response.
        self._verify_response(response, assigned_to_user)
コード例 #11
0
    def test_contact_closed_deals_cases_account(self):
        """
        Test having a contact attached to a contact with no cases or deals.
        """
        assigned_to_user = LilyUserFactory.create(tenant=self.user_obj.tenant,
                                                  is_active=True)
        account = AccountFactory.create(tenant=self.user_obj.tenant,
                                        assigned_to=assigned_to_user)
        Function.objects.create(account=account, contact=self.contact)

        # Make api call.
        response = self.user.get(
            reverse(self.search_url,
                    kwargs={'number': self.phone_number.number}))

        # Verify response.
        self._verify_response(response, assigned_to_user)