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, )
def setUp(self): self.asset = create_asset( sn='1111-1111-1111-1111', invoice_date=datetime.date(2012, 11, 28), support_period=1, deprecation_rate=100, ) self.asset2 = create_asset( sn='1111-1111-1111-1112', invoice_date=datetime.date(2012, 11, 28), support_period=120, deprecation_rate=50, )
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')
def setUp(self): self.client = login_as_su() self.first_asset = create_asset( request_date=datetime.date(2001, 1, 1), sn='1234-1234-1234-1234', ) self.second_asset = create_asset( request_date=datetime.date(2002, 1, 1), sn='1235-1235-1235-1235', ) self.third_asset = create_asset( request_date=datetime.date(2003, 1, 1), sn='1236-1236-1236-1236', )
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.asset = create_asset( sn='1111-1111-1111-1111', invoice_date=datetime.date(2012, 11, 28), support_period=1, slots=12.0, price=100, ) 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, )
def setUp(self): self.client = login_as_su() self.base_url = '/assets/dc/search' self.first_asset = create_asset( production_use_date=datetime.date(2001, 1, 1), sn='1234-1234-1234-1234', ) self.second_asset = create_asset( production_use_date=datetime.date(2002, 1, 1), sn='1235-1235-1235-1235', ) self.third_asset = create_asset( production_use_date=datetime.date(2003, 1, 1), sn='1236-1236-1236-1236', )
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)
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()
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, )
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 )
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()
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.asset = create_asset( sn='1111-1111-1111-1111', invoice_date=datetime.date(2012, 11, 28), support_period=1, deprecation_rate=100, ) self.asset.device_info.ralph_device_id = 666 self.asset.device_info.save() self.asset2 = create_asset( sn='1111-1111-1111-1112', invoice_date=datetime.date(2012, 11, 28), support_period=120, deprecation_rate=50, ) self.asset2.device_info.ralph_device_id = 667 self.asset2.device_info.save() self.asset3 = create_asset( sn='1111-1111-1111-1113', invoice_date=datetime.date(2012, 11, 28), support_period=120, deprecation_rate=50, force_deprecation=True, ) dev1 = Device.create( [('1', 'sda', 0)], model_name='xxx', model_type=DeviceType.rack_server, allow_stub=1, ) dev1.id = 666 dev1.save() dev2 = Device.create( [('1', 'dawdwad', 0)], model_name='Unknown', model_type=DeviceType.unknown, allow_stub=1, ) dev2.id = 667 dev2.save()
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.category = AssetCategory.objects.get(name="Blade System") self.model = create_model( category=self.category ) self.model2 = create_model( 'Model2', category=self.category, ) self.warehouse = create_warehouse() self.asset = create_asset( sn='1111-1111-1111-1111' ) self.asset_id = self.asset.id self.asset.device_info.ralph_device_id = 666 self.asset.device_info.save() self.asset_data_raw = { u'asset_id': 1, u'barcode': None, u'category': u'Blade System', u'delivery_date': None, u'deprecation_rate': 25, u'invoice_date': None, u'invoice_no': None, u'is_deprecated': True, u'manufacturer': u'Manufacturer1', u'model': u'Model1', u'niw': None, u'order_no': None, u'price': 0, u'production_use_date': None, u'provider': None, u'provider_order_date': None, u'rack': None, u'remarks': u'', u'request_date': None, u'size': 0, u'slots': 0.0, u'sn': u'1111-1111-1111-1111', u'source': u'shipment', u'status': u'new', u'support_period': 24, u'support_price': None, u'support_type': u'standard', u'support_void_reporting': True, u'u_height': None, u'u_level': None, u'warehouse': u'Warehouse', }