Beispiel #1
0
    def test_enable_error(self):
        global mock_returns_error
        mock_returns_error = True

        logic = customer_logic.CustomerLogic()

        self.assertRaises(SystemError, logic.enable, 'id',
                          models.Enabled(True), 'trans_id')
        self.assertTrue(data_manager_mock.rollback.called)
Beispiel #2
0
    def test_enable_success(self):
        logic = customer_logic.CustomerLogic()
        logic.enable('customer_id', models.Enabled(True), 'transaction_is')

        self.assertTrue(record_mock.read_customer_by_uuid.called)
        self.assertTrue(customer_logic.RdsProxy.send_customer.called)