Beispiel #1
0
    def setUp(self):
        super().setUp()

        self.group = GroupFactory.create()
        db.session.add(self.group)

        self.group_another = GroupFactory.create()
        db.session.add(self.group_another)

        db.session.commit()

        self.user = UserFactory.create()
        self.user.group = self.group
        db.session.add(self.user)

        self.user_another = UserFactory.create()
        self.user_another.group = self.group_another
        db.session.add(self.user_another)

        db.session.commit()

        self.group_categories = GroupCategoryFactory.create_batch(30)
        for group_category in self.group_categories:
            group_category.group = self.group
            db.session.add(group_category)

        db.session.commit()

        self.api_app = self.create_api_app(self.user)
        self.token = self.get_token(self.api_app, self.user)

        self.api_app_another = self.create_api_app(self.user_another)
        self.token_another = self.get_token(self.api_app_another,
                                            self.user_another)
Beispiel #2
0
    def setUp(self):
        super().setUp()

        self.group = GroupFactory.create()
        db.session.add(self.group)

        self.group_another = GroupFactory.create()
        db.session.add(self.group_another)

        db.session.commit()

        self.user = UserFactory.create()
        self.user.group = self.group
        db.session.add(self.user)

        self.user_another = UserFactory.create()
        self.user_another.group = self.group_another
        db.session.add(self.user_another)

        db.session.commit()

        self.group_currencies = sorted(GroupCurrencyFactory.create_batch(30), key=lambda x: x.name)
        for group_currency in self.group_currencies:
            group_currency.group = self.group
            db.session.add(group_currency)

        db.session.commit()

        self.api_app = self.create_api_app(self.user)
        self.token = self.get_token(self.api_app, self.user)

        self.api_app_another = self.create_api_app(self.user_another)
        self.token_another = self.get_token(self.api_app_another, self.user_another)
    def setUp(self):
        super().setUp()

        self.group = GroupFactory.create()
        db.session.add(self.group)

        self.group_another = GroupFactory.create()
        db.session.add(self.group_another)

        db.session.commit()

        self.user = UserFactory.create()
        self.user.group = self.group
        db.session.add(self.user)

        self.user_another = UserFactory.create()
        self.user_another.group = self.group_another
        db.session.add(self.user_another)

        db.session.commit()

        self.group_categories = GroupCategoryFactory.create_batch(30)
        for group_category in self.group_categories:
            group_category.group = self.group
            db.session.add(group_category)

        db.session.commit()

        self.api_app = self.create_api_app(self.user)
        self.token = self.get_token(self.api_app, self.user)

        self.api_app_another = self.create_api_app(self.user_another)
        self.token_another = self.get_token(self.api_app_another, self.user_another)
Beispiel #4
0
    def setUp(self):
        super().setUp()

        self.user = UserFactory.create()
        db.session.add(self.user)

        self.groups = GroupFactory.create_batch(30)
        for group in self.groups:
            db.session.add(group)
        db.session.commit()

        self.api_app = self.create_api_app(self.user)
        self.token = self.get_token(self.api_app, self.user)
Beispiel #5
0
    def setUp(self):
        super().setUp()

        self.user = UserFactory.create()
        db.session.add(self.user)

        self.groups = GroupFactory.create_batch(30)
        for group in self.groups:
            db.session.add(group)
        db.session.commit()

        self.api_app = self.create_api_app(self.user)
        self.token = self.get_token(self.api_app, self.user)
Beispiel #6
0
    def setUp(self):
        super().setUp()

        self.group = GroupFactory.create()
        db.session.add(self.group)

        self.users = UserFactory.create_batch(30)
        for user in self.users:
            user.group = self.group
            db.session.add(user)

        db.session.commit()

        self.user = self.users[0]
        self.api_app = self.create_api_app(self.user)
        self.token = self.get_token(self.api_app, self.user)
Beispiel #7
0
    def setUp(self):
        super().setUp()

        self.group = GroupFactory.create()
        db.session.add(self.group)

        self.users = UserFactory.create_batch(30)
        for user in self.users:
            user.group = self.group
            db.session.add(user)

        db.session.commit()

        self.user = self.users[0]
        self.api_app = self.create_api_app(self.user)
        self.token = self.get_token(self.api_app, self.user)