# Path: application/app.py
# def index():
# def any_root_path(path):
# def get_user():
# def create_user():
# def get_token():
# def is_token_valid():
# def get_balances():
# def get_balances_route():
# def get_accounts():
# def get_accounts_route():
# def create_account():
# def edit_account():
# def delete_account():
# def get_transactions():
# def get_future_transactions():
# def create_transaction():
# def edit_transaction():
# def tick_transaction():
# def delete_transaction():
# def get_recurring_groups():
# def generate_recurring(account_id, label, amount, start_date, end_date, recurring_group_id, recurrence_day, recurrence_month, future_only=False):
# def create_recurring_group():
# def edit_recurring_group():
# def delete_recurring_group():
# def get_charts():
# 
# Path: application/models.py
# class User(db.Model):
#     id = db.Column(db.Integer(), primary_key=True)
#     email = db.Column(db.String(255), unique=True)
#     password = db.Column(db.String(255))
# 
#     def __init__(self, email, password):
#         self.email = email
#         self.active = True
#         self.password = User.hashed_password(password)
# 
#     @staticmethod
#     def hashed_password(password):
#         return bcrypt.generate_password_hash(password)
# 
#     @staticmethod
#     def get_user_with_email_and_password(email, password):
#         user = User.query.filter_by(email=email).first()
#         if user and bcrypt.check_password_hash(user.password, password):
#             return user
#         else:
#             return None


from flask_testing import TestCase
from application.app import app, db
from application.models import User
from datetime import datetime
from setup import basedir
import os
import json
class BaseTestConfig(TestCase):
    default_user = {
        "email": "default@gmail.com",
        "password": "something2"
    }

    default_account = {
        "label": "test account",
        "bank": "some bank",
        "iban": "FR76 0000 0000 0000 0000",
        "bic": "TESTFRZZ"
    }

    default_transaction = {
        "account_id": 1,
        "label": "some_transaction",
        "amount": 10,
        "tick": 0,
    }

    default_recurring_group = {
        "account_id": 1,
        "label": "that group",
        "amount": 42,
        "recurrence_day": 5,
        "recurrence_month": 12,
    }

    def create_app(self):
        app.config.from_object('config.TestingConfig')

# Path: application/app.py
# def index():
# def any_root_path(path):
# def get_user():
# def create_user():
# def get_token():
# def is_token_valid():
# def get_balances():
# def get_balances_route():
# def get_accounts():
# def get_accounts_route():
# def create_account():
# def edit_account():
# def delete_account():
# def get_transactions():
# def get_future_transactions():
# def create_transaction():
# def edit_transaction():
# def tick_transaction():
# def delete_transaction():
# def get_recurring_groups():
# def generate_recurring(account_id, label, amount, start_date, end_date, recurring_group_id, recurrence_day, recurrence_month, future_only=False):
# def create_recurring_group():
# def edit_recurring_group():
# def delete_recurring_group():
# def get_charts():
# 
# Path: application/models.py
# class User(db.Model):
#     id = db.Column(db.Integer(), primary_key=True)
#     email = db.Column(db.String(255), unique=True)
#     password = db.Column(db.String(255))
# 
#     def __init__(self, email, password):
#         self.email = email
#         self.active = True
#         self.password = User.hashed_password(password)
# 
#     @staticmethod
#     def hashed_password(password):
#         return bcrypt.generate_password_hash(password)
# 
#     @staticmethod
#     def get_user_with_email_and_password(email, password):
#         user = User.query.filter_by(email=email).first()
#         if user and bcrypt.check_password_hash(user.password, password):
#             return user
#         else:
#             return None


# Path: testing_config.py
from flask_testing import TestCase
from application.app import app, db
from application.models import User
from datetime import datetime
from setup import basedir
import os
import json

class BaseTestConfig(TestCase):
    default_user = {
        "email": "default@gmail.com",
        "password": "something2"
    }

    default_account = {
        "label": "test account",
        "bank": "some bank",
        "iban": "FR76 0000 0000 0000 0000",
        "bic": "TESTFRZZ"
    }

    default_transaction = {
        "account_id": 1,
        "label": "some_transaction",
        "amount": 10,
        "tick": 0,
    }

    default_recurring_group = {
        "account_id": 1,
        "label": "that group",
        "amount": 42,
        "recurrence_day": 5,
        "recurrence_month": 12,
    }

    def create_app(self):
        app.config.from_object('config.TestingConfig')

        return app