
from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError


class TestMedicalPrescriptionOrderLine(TransactionCase):

    def setUp(self):
        super(TestMedicalPrescriptionOrderLine, self).setUp()
        self.order_line_1 = self.env.ref(
            'medical_prescription.' +
            'medical_prescription_order_line_patient_1_order_1_line_1'
        )

    def test_check_refill_qty_original(self):
        """ Test refill_qty_original cannot be less than 0 """
        with self.assertRaises(ValidationError):
            self.order_line_1.refill_qty_original = -1


from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError


class TestMedicalPrescriptionOrderLine(TransactionCase):

    def setUp(self):
        super(TestMedicalPrescriptionOrderLine, self).setUp()
        self.order_line_1 = self.env.ref(
            'medical_prescription.' +
            'medical_prescription_order_line_patient_1_order_1_line_1'
        )

    def test_check_refill_qty_original(self):
        """ Test refill_qty_original cannot be less than 0 """
        with self.assertRaises(ValidationError):
            self.order_line_1.refill_qty_original = -1

Upgrade test namespace * Change openerp namespace to odoo in test imports
[MIG] medical_prescription_us: Upgrade test namespace
* Change openerp namespace to odoo in test imports

  
- from openerp.tests.common import TransactionCase
+ from odoo.tests.common import TransactionCase
- from openerp.exceptions import ValidationError
+ from odoo.exceptions import ValidationError
  
  
  class TestMedicalPrescriptionOrderLine(TransactionCase):
  
      def setUp(self):
          super(TestMedicalPrescriptionOrderLine, self).setUp()
          self.order_line_1 = self.env.ref(
              'medical_prescription.' +
              'medical_prescription_order_line_patient_1_order_1_line_1'
          )
  
      def test_check_refill_qty_original(self):
          """ Test refill_qty_original cannot be less than 0 """
          with self.assertRaises(ValidationError):
              self.order_line_1.refill_qty_original = -1
  
Upgrade test namespace * Change openerp namespace to odoo in test imports
## Code Before:

from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError


class TestMedicalPrescriptionOrderLine(TransactionCase):

    def setUp(self):
        super(TestMedicalPrescriptionOrderLine, self).setUp()
        self.order_line_1 = self.env.ref(
            'medical_prescription.' +
            'medical_prescription_order_line_patient_1_order_1_line_1'
        )

    def test_check_refill_qty_original(self):
        """ Test refill_qty_original cannot be less than 0 """
        with self.assertRaises(ValidationError):
            self.order_line_1.refill_qty_original = -1

## Instruction:
Upgrade test namespace * Change openerp namespace to odoo in test imports
## Code After:

from odoo.tests.common import TransactionCase
from odoo.exceptions import ValidationError


class TestMedicalPrescriptionOrderLine(TransactionCase):

    def setUp(self):
        super(TestMedicalPrescriptionOrderLine, self).setUp()
        self.order_line_1 = self.env.ref(
            'medical_prescription.' +
            'medical_prescription_order_line_patient_1_order_1_line_1'
        )

    def test_check_refill_qty_original(self):
        """ Test refill_qty_original cannot be less than 0 """
        with self.assertRaises(ValidationError):
            self.order_line_1.refill_qty_original = -1
