Beispiel #1
0
def drop_all_and_create():
    """A function to drop and then recreate the database tables."""

    with app.app_context():
        database.reflect()
        database.drop_all()
        database.create_all()
    def setUp(self):
        self.app = create_app('TEST')
        self.app.testing = True
        self.test_client = self.app.test_client()
        self.parameters = {
            'reference_number': '101',
            'method_used': 'Check',
            'date_of_method_used': '2018-07-12 00:00:00',
            'given_to': 'NERF',
            'transaction_type': 'Gift',
            'gross_gift_amount': Decimal(10.00),
            'transaction_status': 'Completed',
            'new_user_email': '*****@*****.**',
            'customer_id': 'customer_id',
            'second_transaction_type': 'Deposit to Bank',
            'bank_deposit_number': '<bank-deposit-number>'
        }

        with self.app.app_context():
            database.reflect()
            database.drop_all()
            database.create_all()

            # Create some ultsys user data for the Ultsys endpoints wrapped in functions for mocking.
            create_ultsys_users()

            database.session.add_all(create_method_used())
            database.session.commit()
            self.method_used_id = MethodUsedModel.get_method_used(
                'name', self.parameters['method_used']).id
Beispiel #3
0
    def setUp(self):
        self.app = create_app('TEST')
        self.app.testing = True
        self.test_client = self.app.test_client()

        self.parameters = {
            'reference_number': 'braintree_reference_number',
            'user_exists_id': 5,
            'user_new_id': '67',
            'customer_id': 'customer_id',
            'method_used': 'Web Form Credit Card',
            'given_to': 'NERF',
            'transaction_status': 'Completed',
            'transaction_type': 'Gift',
            'gross_gift_amount': Decimal(25.00),
            'fee': Decimal(0.00)
        }

        init_braintree_credentials(self.app)

        with self.app.app_context():
            database.reflect()
            database.drop_all()
            database.create_all()

            # Create some ultsys user data for the Ultsys endpoints wrapped in functions for mocking.
            create_ultsys_users()

            database.session.add_all(create_method_used())
            database.session.commit()
            self.method_used_id = MethodUsedModel.get_method_used(
                'name', self.parameters['method_used']).id
Beispiel #4
0
    def setUp(self):
        self.app = create_app('TEST')
        self.app.testing = True
        self.test_client = self.app.test_client()

        self.parameters = {
            'gift_amount_refund': Decimal('1.00'),
            'gift_amount_reallocate': Decimal('25.00'),
            'gift_amount_bounced': Decimal('0.00'),
            'transaction_type_void': 'Void',
            'transaction_type_bounced': 'Bounced',
            'transaction_type_refund': 'Refund',
            'transaction_type_correction': 'Correction'
        }

        with self.app.app_context():
            database.reflect()
            database.drop_all()
            database.create_all()

            # Create some ultsys user data for the Ultsys endpoints wrapped in functions for mocking.
            create_ultsys_users()

            database.session.add_all(create_method_used())
            database.session.commit()
Beispiel #5
0
 def setUp( self ):
     self.app = create_app( 'TEST' )
     self.app.testing = True
     self.test_client = self.app.test_client()
     self.access_token = ACCESS_TOKEN
     self.headers = { 'Authorization': 'Bearer {}'.format( self.access_token ) }
     with self.app.app_context():
         database.reflect()
         database.drop_all()
         database.create_all()
    def setUp(self):
        self.app = create_app('TEST')
        self.app.testing = True
        self.test_client = self.app.test_client()

        with self.app.app_context():
            database.reflect()
            database.drop_all()
            database.create_all()

            # Create some ultsys user data for the Ultsys endpoints wrapped in functions for mocking.
            create_ultsys_users()
    def setUp(self):
        self.app = create_app('TEST')
        self.app.testing = True
        self.test_client = self.app.test_client()

        self.parameters = {}

        init_braintree_credentials(self.app)

        with self.app.app_context():
            database.reflect()
            database.drop_all()
            database.create_all()

            database.session.add_all(create_method_used())
            database.session.commit()
 def tearDown(self):
     with self.app.app_context():
         database.reflect()
         database.drop_all()
         database.create_all()
         database.session.close()