def setUpTestData(cls) -> None:
        # test variables
        cls.measurement_report_count = 6
        # new
        cls.view_client = ViewClient()
        cls.client = ClientFactory.create()
        cls.product = ProductFactory.create()
        cls.order_new = OrderFactory.create(client=cls.client,
                                            product=cls.product)

        # update
        cls.order_update = OrderFactory.create(client=cls.client,
                                               product=cls.product)
        cls.measurement_report = MeasurementReportFactory.create(
            order=cls.order_update)
        for i in range(cls.measurement_report_count):
            MeasurementFactory.create(
                measurement_report=cls.measurement_report)

        # post data
        cls.order_data = OrderPostDictProvider().get_post_data_as_dict()
        cls.meas_report_data = MeasurementReportPostDictProvider(
        ).get_post_data_as_dict()
        cls.meas_data = MeasurementsPostDictProvider(
            measurements_count=cls.measurement_report_count
        ).get_post_data_as_dict()

        cls.form_data = {
            **cls.meas_data,
            **cls.meas_report_data,
        }

        cls.user = CxUserFactory.create()
 def setUp(self):
     self.client = ClientFactory.create()
     self.product = ProductFactory.create()
     self.order = OrderFactory.create(product=self.product,
                                      client=self.client)
     self.measurement_report = MeasurementReportFactory.create(
         order=self.order)
     self.form_data = {
         'date_of_control': '4892-09-05',
         'author': 'Jan Kowalski'
     }
 def setUp(self):
     self.client = ClientFactory.create()
     self.product = ProductFactory.create()
     self.order = OrderFactory.create(product=self.product,
                                      client=self.client)
     self.measurement_report = MeasurementReportFactory.create(
         order=self.order)
     self.measurement = MeasurementFactory.create(
         measurement_report=self.measurement_report)
     self.form_data = {}
     for field in Measurement._meta.get_fields():
         if field.name not in ['id', 'measurement_report']:
             self.form_data[field.name] = '1'
Пример #4
0
    def setUp(self) -> None:
        self.product = ProductFactory.create()
        self.spec = SpecificationFactory.create(product=self.product)

        self.product_form = {'product_sap_id': str(get_random_int_with_digit_count(PRODUCT_SAP_DIGITS)),
                             'description': "Product new", 'index': ""}
        self.spec_form = {}
        for field in Specification._meta.get_fields():
            if field.name != 'product':
                self.spec_form[field.name] = '1'
        self.spec_form['pallet_protected_with_paper_edges'] = 'Y'
        self.spec_form['cores_packed_in'] = 'Horizontal'
        self.spec_form['pallet_wrapped_with_stretch_film'] = 'Y'
Пример #5
0
    def setUpTestData(cls) -> None:
        cls.view_client = ViewClient()
        cls.product = ProductFactory.create()
        cls.client = ClientFactory.create()
        cls.client_post_form = ClientFactory.create()
        cls.specification = SpecificationFactory.create(product=cls.product)

        cls.specification_issued = SpecificationIssuedFactory.create(
            product=cls.product, client=cls.client)
        cls.form_data = {
            'client_sap_id': cls.client_post_form.client_sap_id,
            'date_of_issue': cls.specification_issued.date_of_issue
        }

        cls.user = CxUserFactory.create()
    def setUp(self) -> None:
        self.client = ClientFactory.create()
        self.product = ProductFactory.create()
        self.order = OrderFactory.create(product=self.product,
                                         client=self.client)

        self.form_data = {
            'order_sap_id':
            str(get_random_int_with_digit_count(ORDER_SAP_DIGITS)),
            'client': str(self.client.client_sap_id),
            'product': str(self.product.product_sap_id),
            'date_of_production': '5896-12-12',
            'status': 'Ready',
            'quantity': '10',
            'internal_diameter_reference': '1.7',
            'external_diameter_reference': '1.2',
            'length': '42.3'
        }
Пример #7
0
    def setUpTestData(cls) -> None:
        cls.view_client = ViewClient()
        cls.products = ProductFactory.create_batch(size=6)
        cls.specifications = [
            SpecificationFactory.create(product=product)
            for product in cls.products
        ]
        cls.product_to_be_deleted = cls.products[0]
        cls.product_to_be_updated = cls.products[1]
        cls.form_data = {
            'product_sap_id':
            get_random_int_with_digit_count(PRODUCT_SAP_DIGITS),
            'description': "product_form_data",
            'index': ""
        }
        for field in Specification._meta.get_fields():
            if field.name != 'product':
                cls.form_data[f'{field.name}'] = '999'
        cls.form_data['pallet_protected_with_paper_edges'] = 'Y'
        cls.form_data['cores_packed_in'] = 'Horizontal'
        cls.form_data['pallet_wrapped_with_stretch_film'] = 'Y'

        cls.user = CxUserFactory.create()
    def setUpTestData(cls) -> None:
        # Orders
        cls.view_client = ViewClient()
        cls.clients = ClientFactory.create_batch(size=6)
        cls.products = ProductFactory.create_batch(size=6)
        cls.orders = [
            OrderFactory.create(product=product, client=client)
            for client, product in zip(cls.clients, cls.products)
        ]
        cls.order_to_be_deleted = cls.orders[0]
        cls.order_to_be_updated = cls.orders[1]

        cls.client_sap_id_form_data = cls.clients[-1].client_sap_id
        cls.product_sap_id_form_data = cls.products[-1].product_sap_id
        cls.form_data = {
            'order_sap_id': get_random_int_with_digit_count(ORDER_SAP_DIGITS),
            'client': cls.client_sap_id_form_data,
            'product': cls.product_sap_id_form_data,
            'date_of_production': '5896-12-12',
            'status': 'Ready',
            'quantity': 10,
        }

        cls.user = CxUserFactory.create()