def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()

            scheduling = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'scheduling_user',
            )

            scheduled = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'scheduled_user',
            )

            cls.scheduling_uid = scheduling.public_id
            cls.scheduled_uid = scheduled.public_id

            db.session.add(scheduling)
            db.session.add(scheduled)
            db.session.commit()

            User.query.filter_by(
                public_id=cls.scheduled_uid
            ).update({
                'sixty_min_price': 15
            })

            db.session.add(Submerchant(
                cls.scheduled_uid,
                'testaccountid',
                'firstName',
                'LastName',
                'email',
                datetime.utcnow() + timedelta(days=-365*20),
                'address_street',
                'address_locality',
                'address_region',
                'address_zip',
            ))

            new_schedule = Schedule(
                datetime.utcnow(),
                datetime.utcnow() + timedelta(minutes=60),
                cls.scheduled_uid,
                'US/Central'
            )

            db.session.add(new_schedule)
            db.session.commit()

            cls.new_schedule_id = new_schedule.id
Пример #2
0
    def setUpClass(cls):
        with app.app_context():
            app.config['TESTING'] = True

            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()
Пример #3
0
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = MerchantDAO()

            db.session.add(MasterMerchant('clarksoftware'))
            db.session.commit()
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()

            test_user = User(
                '*****@*****.**',
                'testpw',
                'US/Central',
                'auth_test_user',
            )

            db.session.add(test_user)
            db.session.commit()

            cls.scheduled_uid = test_user.public_id
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()

            test_user = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'test-verify',
            )

            test_user2 = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'test-verify2',
            )

            test_user3 = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'test-verify3',
            )

            cls.test_user_token = test_user.verify_token
            cls.test_uid = test_user.public_id
            cls.test_user2_token = test_user2.verify_token
            cls.test_uid2 = test_user2.public_id
            cls.test_user_email3 = test_user3.email
            cls.test_uid3 = test_user3.public_id

            db.session.add(test_user)
            db.session.add(test_user2)
            db.session.add(test_user3)
            db.session.commit()
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()

            test_user = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'test',
            )

            deleted_user = User(
                "*****@*****.**",
                "testpassword",
                'US/Central',
                'delete-test',
            )
            deleted_user.is_deleted = True

            user_to_delete = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'user-to-delete',
            )

            cls.test_uid = test_user.public_id
            cls.deleted_uid = deleted_user.public_id
            cls.to_delete_uid = user_to_delete.public_id

            db.session.add(MasterMerchant('clarksoftware'))
            db.session.add(test_user)
            db.session.add(deleted_user)
            db.session.add(user_to_delete)
            db.session.commit()
    def setUpClass(cls):
        with app.app_context():
            app.config['TESTING'] = True

            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()

            test_user = User(
                "*****@*****.**",
                "testpw",
                'US/Central',
                'test',
            )

            cls.test_uid = test_user.public_id

            db.session.add(test_user)
            db.session.commit()

            cls.schedule_ids = []
            for i in range(10):
                start_time = datetime.utcnow()
                end_time = datetime.utcnow() + timedelta(minutes=60)
                if i >= 7:
                    start_time = datetime.utcnow() + timedelta(minutes=120)
                    end_time = datetime.utcnow() + timedelta(minutes=180)

                new_schedule = Schedule(start_time, end_time, cls.test_uid,
                                        'US/Central')

                db.session.add(new_schedule)
                db.session.commit()
                cls.schedule_ids.append(new_schedule.public_id)
Пример #8
0
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
    def setUpClass(cls):
        with app.app_context():
            db.drop_all()
            db.create_all()

            cls.test_client = app.test_client()
            cls.test_dao = UserDAO()

            scheduling = User(
                "*****@*****.**",
                "testpw",
                'UTC',
                'scheduling_user1',
            )

            scheduled = User(
                "*****@*****.**",
                "testpw",
                'UTC',
                'scheduled_user2',
            )

            cls.scheduling_uid = scheduling.public_id
            cls.scheduled_uid = scheduled.public_id

            db.session.add(scheduling)
            db.session.add(scheduled)
            db.session.commit()

            default_address = Address(
                cls.scheduling_uid,
                'first-default',
                'last-default',
                'street address1',
                'Madison',
                'WI',
                '53703-def',
                'US',
                is_default=True,
                extended_address=None
            )

            db.session.add(default_address)
            db.session.commit()

            User.query.filter_by(
                public_id=cls.scheduled_uid
            ).update({
                'sixty_min_price': 15
            })

            db.session.commit()

            db.session.add(Submerchant(
                cls.scheduled_uid,
                '3bX9oSVaocidZMxWGGMybj',
                'firstName',
                'LastName',
                'email',
                datetime.utcnow() + timedelta(days=-365*20),
                'address_street',
                'address_locality',
                'address_region',
                'address_zip',
            ))

            new_schedule = Schedule(
                datetime.utcnow(),
                datetime.utcnow() + timedelta(minutes=60),
                cls.scheduled_uid,
                'UTC'
            )

            db.session.add(new_schedule)
            db.session.commit()

            cls.new_schedule_id = new_schedule.id