Beispiel #1
0
    def setUp(self):
        self.category = create_category()
        self.category.is_blade = True
        self.category.save()
        self.asset = create_asset(
            sn='1111-1111-1111-1111',
            invoice_date=datetime.date(2012, 11, 28),
            support_period=1,
            slots=12.0,
            price=100,
            deprecation_rate=100,
            category=self.category,
        )

        part_info = PartInfo(device=self.asset)
        part_info.save()
        self.asset2 = create_asset(
            sn='1111-1111-1111-11132',
            invoice_date=datetime.date(2012, 11, 28),
            support_period=1,
            slots=12.0,
            price=100,
            part_info=part_info,
            deprecation_rate=50,
            category=self.category,
        )
Beispiel #2
0
    def setUp(self):
        self.category = create_category()
        self.category.is_blade = True
        self.category.save()
        self.asset = create_asset(
            sn='1111-1111-1111-1111',
            invoice_date=datetime.date(2012, 11, 28),
            support_period=1,
            slots=12.0,
            price=100,
            deprecation_rate=100,
            category=self.category,
        )

        part_info = PartInfo(device=self.asset)
        part_info.save()
        self.asset2 = create_asset(
            sn='1111-1111-1111-11132',
            invoice_date=datetime.date(2012, 11, 28),
            support_period=1,
            slots=12.0,
            price=100,
            part_info=part_info,
            deprecation_rate=50,
            category=self.category,
        )
Beispiel #3
0
 def setUp(self):
     self.client = login_as_su()
     self.category = create_category()
     self.manufacturer = AssetManufacturer(name='test_manufacturer')
     self.manufacturer.save()
     self.model = AssetModel(name='test_model',
                             manufacturer=self.manufacturer)
     self.model.save()
     self.warehouse = Warehouse(name='test_warehouse')
     self.warehouse.save()
     self.asset_params = {
         'type': AssetType.data_center.id,
         'model': self.model.id,
         'invoice_no': 00001,
         'order_no': 2,
         'invoice_date': '2012-11-29',
         'support_period': 36,
         'support_type': 'door-to-door',
         'support_void_reporting': 'on',
         'provider': 'test_provider',
         'status': AssetStatus.new.id,
         'remarks': 'test_remarks',
         'price': 10,
         'size': 1,
         'warehouse': self.warehouse.id,
         'barcode': '7777',
         'category': self.category.id,
         'slots': 0,
         'sn': 'fake-sn',
         'ralph_device_id': '',
         'asset': True,  # Button name
         'source': 1,
         'deprecation_rate': 0,
         'production_year': 2011,
     }
 def setUp(self):
     self.client = login_as_su()
     self.category = create_category()
     self.manufacturer = AssetManufacturer(name='test_manufacturer')
     self.manufacturer.save()
     self.model = AssetModel(
         name='test_model', manufacturer=self.manufacturer
     )
     self.model.save()
     self.warehouse = Warehouse(name='test_warehouse')
     self.warehouse.save()
     self.asset_params = {
         'type': AssetType.data_center.id,
         'model': self.model.id,
         'invoice_no': 00001,
         'order_no': 2,
         'invoice_date': '2012-11-29',
         'support_period': 36,
         'support_type': 'door-to-door',
         'support_void_reporting': 'on',
         'provider': 'test_provider',
         'status': AssetStatus.new.id,
         'remarks': 'test_remarks',
         'price': 10,
         'size': 1,
         'warehouse': self.warehouse.id,
         'barcode': '7777',
         'category': self.category.id,
         'slots': 0,
         'sn': 'fake-sn',
         'ralph_device_id': '',
         'asset': True,  # Button name
         'source': 1,
     }
Beispiel #5
0
 def setUp(self):
     self.client = login_as_su()
     self.model = create_model()
     self.model2 = create_model('Model2')
     self.warehouse = create_warehouse()
     self.warehouse2 = create_warehouse('Warehouse2')
     self.category = create_category()
     self.asset = create_asset(sn='1111-1111-1111-1111',
                               category=self.category)
Beispiel #6
0
    def setUp(self):
        self.user = User.objects.create_user('user', '*****@*****.**')
        self.user.is_staff = False
        self.user.is_superuser = False
        self.user.first_name = 'Elmer'
        self.user.last_name = 'Stevens'
        self.user.save()

        self.owner = User.objects.create_user('owner', '*****@*****.**')
        self.owner.is_staff = False
        self.owner.is_superuser = False
        self.owner.first_name = 'Eric'
        self.owner.last_name = 'Brown'
        self.owner.save()

        self.category = create_category()
        self.model = create_model(category=self.category)
        self.asset = create_asset(
            sn='1111-1111-1111-1111',
            model=self.model,
            user=self.user,
            owner=self.owner,
            barcode='br-666',
            niw='niw=666',
        )

        self.software_category = SoftwareCategory(
            name='soft-cat1', asset_type=AssetType.DC
        )
        self.software_category.save()

        self.manufacturer = AssetManufacturer(name='test_manufacturer')
        self.manufacturer.save()

        self.licence_type = LicenceType(name='test_licence_type')
        self.licence_type.save()

        self.property_of = AssetOwner(name="test_property")
        self.property_of.save()

        self.licence1 = Licence(
            licence_type=self.licence_type,
            software_category=self.software_category,
            manufacturer=self.manufacturer,
            property_of=self.property_of,
            number_bought=10,
            sn="test-sn",
            niw="niw-666",
            invoice_date=datetime.date(2014, 4, 28),
            invoice_no="666-999-666",
            price=1000.0,
            provider="test_provider",
            asset_type=AssetType.DC,
        )
        self.licence1.save()
Beispiel #7
0
    def setUp(self):
        self.user = User.objects.create_user('user', '*****@*****.**')
        self.user.is_staff = False
        self.user.is_superuser = False
        self.user.first_name = 'Elmer'
        self.user.last_name = 'Stevens'
        self.user.save()

        self.owner = User.objects.create_user('owner', '*****@*****.**')
        self.owner.is_staff = False
        self.owner.is_superuser = False
        self.owner.first_name = 'Eric'
        self.owner.last_name = 'Brown'
        self.owner.save()

        self.category = create_category()
        self.model = create_model(category=self.category)
        self.asset = create_asset(
            sn='1111-1111-1111-1111',
            model=self.model,
            user=self.user,
            owner=self.owner,
            barcode='br-666',
            niw='niw=666',
        )

        self.software_category = SoftwareCategory(
            name='soft-cat1', asset_type=models_assets.AssetType.DC)
        self.software_category.save()

        self.manufacturer = AssetManufacturer(name='test_manufacturer')
        self.manufacturer.save()

        self.licence_type = LicenceType(name='test_licence_type')
        self.licence_type.save()

        self.property_of = AssetOwner(name="test_property")
        self.property_of.save()

        self.licence1 = Licence(
            licence_type=self.licence_type,
            software_category=self.software_category,
            manufacturer=self.manufacturer,
            property_of=self.property_of,
            number_bought=10,
            sn="test-sn",
            niw="niw-666",
            invoice_date=datetime.date(2014, 4, 28),
            invoice_no="666-999-666",
            price=1000.0,
            provider="test_provider",
            asset_type=models_assets.AssetType.DC,
        )
        self.licence1.save()
Beispiel #8
0
 def setUp(self):
     self.client = login_as_su()
     self.model = create_model()
     self.model2 = create_model('Model2')
     self.warehouse = create_warehouse()
     self.warehouse2 = create_warehouse('Warehouse2')
     self.category = create_category()
     self.asset = create_asset(
         sn='1111-1111-1111-1111',
         category=self.category
     )
Beispiel #9
0
 def setUp(self):
     self.client = login_as_su()
     self.category = create_category()
     asset_fields = dict(
         barcode='123456789',
         invoice_no='Invoice #1',
         order_no='Order #1',
         invoice_date=datetime.date(2001, 1, 1),
         sn='0000-0000-0000-0000',
         category=self.category,
     )
     self.asset = create_asset(**asset_fields)
 def setUp(self):
     self.client = login_as_su()
     self.category = create_category()
     asset_fields = dict(
         barcode='123456789',
         invoice_no='Invoice #1',
         order_no='Order #1',
         invoice_date=datetime.date(2001, 1, 1),
         sn='0000-0000-0000-0000',
         category=self.category,
     )
     self.asset = create_asset(**asset_fields)
Beispiel #11
0
 def setUp(self):
     self.client = login_as_su()
     self.category = create_category()
     self.asset = create_asset(
         sn='1111-1111-1111-1111',
         category=self.category,
     )
     self.asset1 = create_asset(
         sn='2222-2222-2222-2222',
         category=self.category,
     )
     self.model = create_model()  # u'Model1'
     self.model1 = create_model(name='Model2')
Beispiel #12
0
 def setUp(self):
     self.client = login_as_su()
     self.category = create_category(type='back_office')
     self.manufacturer = AssetManufacturer(name='test_manufacturer')
     self.manufacturer.save()
     self.model = AssetModel(
         name='test_model', manufacturer=self.manufacturer
     )
     self.model.save()
     self.warehouse = Warehouse(name='test_warehouse')
     self.warehouse.save()
     self.asset_params = {
         'type': 101,
         'model': self.model.id,
         'invoice_no': 123,
         'order_no': 1,
         'invoice_date': '2012-11-28',
         'support_period': 24,
         'support_type': 'standard',
         'support_void_reporting': 'on',
         'provider': 'test_provider',
         'status': AssetStatus.new.id,
         'remarks': 'test_remarks',
         'size': 1,
         'price': 10,
         'warehouse': self.warehouse.id,
         'sn': '666-666-666',
         'barcode': '666666',
         'category': self.category.id,
         'slots': 1.0,
         'ralph_device_id': '',
         'asset': True,  # Button name
         'source': 1,
         'deprecation_rate': 0,
         'production_year': 2011,
     }
     self.asset_change_params = {
         'barcode': '777777',
         'status': AssetStatus.damaged.id,
         'license_key': '66-66-66',
         'version': '0.1',
         'unit_price': 666.6,
         'license_type': LicenseType.oem.id,
         'date_of_last_inventory': '2012-11-08',
         'last_logged_user': '******',
     }
     self.asset = None
     self.add_bo_device_asset()
     self.edit_bo_device_asset()
Beispiel #13
0
 def setUp(self):
     self.client = login_as_su()
     self.category = create_category(type='back_office')
     self.manufacturer = AssetManufacturer(name='test_manufacturer')
     self.manufacturer.save()
     self.model = AssetModel(name='test_model',
                             manufacturer=self.manufacturer)
     self.model.save()
     self.warehouse = Warehouse(name='test_warehouse')
     self.warehouse.save()
     self.asset_params = {
         'type': 101,
         'model': self.model.id,
         'invoice_no': 123,
         'order_no': 1,
         'invoice_date': '2012-11-28',
         'support_period': 24,
         'support_type': 'standard',
         'support_void_reporting': 'on',
         'provider': 'test_provider',
         'status': AssetStatus.new.id,
         'remarks': 'test_remarks',
         'size': 1,
         'price': 10,
         'warehouse': self.warehouse.id,
         'sn': '666-666-666',
         'barcode': '666666',
         'category': self.category.id,
         'slots': 1.0,
         'ralph_device_id': '',
         'asset': True,  # Button name
         'source': 1,
         'deprecation_rate': 0,
         'production_year': 2011,
     }
     self.asset_change_params = {
         'barcode': '777777',
         'status': AssetStatus.damaged.id,
         'license_key': '66-66-66',
         'version': '0.1',
         'unit_price': 666.6,
         'license_type': LicenseType.oem.id,
         'date_of_last_inventory': '2012-11-08',
         'last_logged_user': '******',
     }
     self.asset = None
     self.add_bo_device_asset()
     self.edit_bo_device_asset()
    def setUp(self):
        self.client = login_as_su()
        self.category = create_category()
        self.first_asset = create_asset(sn="1234-1234-1234-1234", category=self.category)

        self.asset_with_duplicated_sn = create_asset(sn="1111-1111-1111-1111", category=self.category)

        # Prepare required fields (formset_name, field_name)
        self.required_fields = [
            ("asset_form", "model"),
            ("asset_form", "support_period"),
            ("asset_form", "support_type"),
            ("asset_form", "warehouse"),
            ("asset_form", "category"),
        ]

        self.model1 = create_model()
    def setUp(self):
        self.client = login_as_su()
        self.category = create_category()
        self.first_asset = create_asset(
            invoice_date=datetime.date(2001, 1, 1),
            sn='1234-1234-1234-1234',
            category=self.category,
        )

        self.second_asset = create_asset(
            invoice_date=datetime.date(2002, 1, 1),
            sn='1235-1235-1235-1235',
            category=self.category,
        )

        self.third_asset = create_asset(
            invoice_date=datetime.date(2003, 1, 1),
            sn='1236-1236-1236-1236',
            category=self.category,
        )
Beispiel #16
0
    def setUp(self):
        self.client = login_as_su()
        self.category = create_category()
        self.first_asset = create_asset(
            invoice_date=datetime.date(2001, 1, 1),
            sn='1234-1234-1234-1234',
            category=self.category,
        )

        self.second_asset = create_asset(
            invoice_date=datetime.date(2002, 1, 1),
            sn='1235-1235-1235-1235',
            category=self.category,
        )

        self.third_asset = create_asset(
            invoice_date=datetime.date(2003, 1, 1),
            sn='1236-1236-1236-1236',
            category=self.category,
        )
Beispiel #17
0
    def setUp(self):
        self.client = login_as_su()
        self.category = create_category()
        self.first_asset = create_asset(
            invoice_no='Invoice No1',
            order_no='Order No2',
            invoice_date=datetime.date(2001, 1, 1),
            support_type='Support d2d',
            provider='Provider1',
            sn='1234-1234-1234-1234',
            barcode='bc1',
            category=self.category,
        )

        self.second_asset = create_asset(
            invoice_no='Invoice No2',
            order_no='Order No1',
            invoice_date=datetime.date(2001, 1, 1),
            support_type='Support d2d',
            provider='Provider2',
            sn='1235-1235-1235-1235',
            barcode='bc2',
            category=self.category,
        )

        asset_model = create_model(name='Model2')
        asset_status = AssetStatus.used.id
        self.third_asset = create_asset(
            model=asset_model,
            invoice_no='Invoice No1',
            order_no='Order No1',
            invoice_date=datetime.date(2001, 1, 1),
            support_type='Support d2d',
            provider='Provider1',
            sn='1236-1236-1236-1236',
            barcode='bc3',
            status=asset_status,
            category=self.category,
        )
    def setUp(self):
        self.client = login_as_su()
        self.category = create_category()
        self.first_asset = create_asset(
            invoice_no='Invoice No1',
            order_no='Order No2',
            invoice_date=datetime.date(2001, 1, 1),
            support_type='Support d2d',
            provider='Provider1',
            sn='1234-1234-1234-1234',
            barcode='bc1',
            category=self.category,
        )

        self.second_asset = create_asset(
            invoice_no='Invoice No2',
            order_no='Order No1',
            invoice_date=datetime.date(2001, 1, 1),
            support_type='Support d2d',
            provider='Provider2',
            sn='1235-1235-1235-1235',
            barcode='bc2',
            category=self.category,
        )

        asset_model = create_model(name='Model2')
        asset_status = AssetStatus.used.id
        self.third_asset = create_asset(
            model=asset_model,
            invoice_no='Invoice No1',
            order_no='Order No1',
            invoice_date=datetime.date(2001, 1, 1),
            support_type='Support d2d',
            provider='Provider1',
            sn='1236-1236-1236-1236',
            barcode='bc3',
            status=asset_status,
            category=self.category,
        )
    def setUp(self):
        self.client = login_as_su()
        self.category = create_category()
        self.first_asset = create_asset(
            sn='1234-1234-1234-1234',
            category=self.category,
        )

        self.asset_with_duplicated_sn = create_asset(
            sn='1111-1111-1111-1111',
            category=self.category,
        )

        # Prepare required fields (formset_name, field_name)
        self.required_fields = [
            ('asset_form', 'model'),
            ('asset_form', 'support_period'),
            ('asset_form', 'support_type'),
            ('asset_form', 'warehouse'),
            ('asset_form', 'category'),
        ]

        self.model1 = create_model()
    def setUp(self):
        self.client = login_as_su()
        self.category = create_category()
        self.first_asset = create_asset(
            sn='1234-1234-1234-1234',
            category=self.category,
        )

        self.asset_with_duplicated_sn = create_asset(
            sn='1111-1111-1111-1111',
            category=self.category,
        )

        # Prepare required fields (formset_name, field_name)
        self.required_fields = [
            ('asset_form', 'model'),
            ('asset_form', 'support_period'),
            ('asset_form', 'support_type'),
            ('asset_form', 'warehouse'),
            ('asset_form', 'category'),
        ]

        self.model1 = create_model()
 def setUp(self):
     self.client = login_as_su()
     self.warehouse = create_warehouse()
     self.model = create_model()
     self.category = create_category()
     self.addform = '/assets/dc/add/device/'
Beispiel #22
0
 def setUp(self):
     self.client = login_as_su()
     self.warehouse = create_warehouse()
     self.model = create_model()
     self.category = create_category()
     self.addform = '/assets/dc/add/device/'