Ejemplo n.º 1
0
    def test_display_data_in_table(self):
        get_search_page = self.client.get('/assets/dc/search')
        self.assertEqual(get_search_page.status_code, 200)

        # Test if data from database are displayed in correct row.
        first_table_row = get_search_page.context_data['bob_page'][0]
        self.assertEqual(self.asset, first_table_row)
        self.assertItemsEqual(
            [
                first_table_row.barcode,
                first_table_row.invoice_no,
                first_table_row.order_no,
                unicode(first_table_row.invoice_date),
                first_table_row.sn,
                AssetType.name_from_id(first_table_row.type),
                AssetStatus.name_from_id(first_table_row.status),
                first_table_row.model.name,
                first_table_row.warehouse.name,
            ],
            [
                u'123456789',
                u'Invoice #1',
                u'Order #1',
                u'2001-01-01',
                u'0000-0000-0000-0000',
                u'Model1',
                'data_center',
                'new',
                'Warehouse',
            ]
        )
Ejemplo n.º 2
0
    def test_display_data_in_table(self):
        get_search_page = self.client.get('/assets/dc/search')
        self.assertEqual(get_search_page.status_code, 200)

        # Test if data from database are displayed in correct row.
        first_table_row = get_search_page.context_data['bob_page'][0]
        self.assertEqual(self.asset, first_table_row)
        self.assertItemsEqual([
            first_table_row.barcode,
            first_table_row.invoice_no,
            first_table_row.order_no,
            unicode(first_table_row.invoice_date),
            first_table_row.sn,
            AssetType.name_from_id(first_table_row.type),
            AssetStatus.name_from_id(first_table_row.status),
            first_table_row.model.name,
            first_table_row.warehouse.name,
        ], [
            u'123456789',
            u'Invoice #1',
            u'Order #1',
            u'2001-01-01',
            u'0000-0000-0000-0000',
            u'Model1',
            'data_center',
            'new',
            'Warehouse',
        ])