fix reports test and fixtures

This commit is contained in:
JNadeu 2018-11-13 17:58:26 +01:00
parent ee231aecb9
commit 3e636ea2c9
3 changed files with 9 additions and 4 deletions

View File

@ -1,11 +1,14 @@
import csv
import datetime
from io import StringIO
import marshmallow
from flask import current_app as app, render_template, request
from flask import current_app as app, render_template, request, make_response
from flask.json import jsonify
from flask_sqlalchemy import Pagination
from marshmallow import fields, fields as f, validate as v
from sqlalchemy.orm import aliased
from sqlalchemy.util import OrderedDict
from teal import query
from teal.cache import cache
from teal.resource import View
@ -14,7 +17,9 @@ from ereuse_devicehub import auth
from ereuse_devicehub.db import db
from ereuse_devicehub.query import SearchQueryParser
from ereuse_devicehub.resources import search
from ereuse_devicehub.resources.device.models import Component, Computer, Device, Manufacturer
from ereuse_devicehub.resources.device.models import Component, Computer, Device, Manufacturer, \
Display, Processor, GraphicCard, Motherboard, NetworkAdapter, DataStorage, RamModule, \
SoundCard
from ereuse_devicehub.resources.device.search import DeviceSearch
from ereuse_devicehub.resources.event.models import Rate
from ereuse_devicehub.resources.lot.models import LotDeviceDescendants

View File

@ -1,2 +1,2 @@
Type,Chassis,Tag 1,Tag 2,Tag 3,Serial Number,Model,Manufacturer,Price,Registered in,Processor,RAM (GB),Storage Size (MB),Rate,Range,Processor Rate,Processor Range,RAM Rate,RAM Range,Data Storage Rate,Data Storage Range,DataStorage 1,DataStorage 1 Manufacturer,DataStorage 1 Model,DataStorage 1 Serial Number,DataStorage 2,DataStorage 2 Manufacturer,DataStorage 2 Model,DataStorage 2 Serial Number,DataStorage 3,DataStorage 3 Manufacturer,DataStorage 3 Model,DataStorage 3 Serial Number,DataStorage 4,DataStorage 4 Manufacturer,DataStorage 4 Model,DataStorage 4 Serial Number,Display 1,Display 1 Manufacturer,Display 1 Model,Display 1 Serial Number,GraphicCard 1,GraphicCard 1 Manufacturer,GraphicCard 1 Model,GraphicCard 1 Serial Number,GraphicCard 1 Memory (MB),GraphicCard 2,GraphicCard 2 Manufacturer,GraphicCard 2 Model,GraphicCard 2 Serial Number,Motherboard 1,Motherboard 1 Manufacturer,Motherboard 1 Model,Motherboard 1 Serial Number,NetworkAdapter 1,NetworkAdapter 1 Manufacturer,NetworkAdapter 1 Model,NetworkAdapter 1 Serial Number,NetworkAdapter 2,NetworkAdapter 2 Manufacturer,NetworkAdapter 2 Model,NetworkAdapter 2 Serial Number,Processor 1,Processor 1 Manufacturer,Processor 1 Model,Processor 1 Serial Number,Processor 1 Number of cores,Processor 1 Speed (GHz),Processor 2,Processor 2 Manufacturer,Processor 2 Model,Processor 2 Serial Number,RamModule 1,RamModule 1 Manufacturer,RamModule 1 Model,RamModule 1 Serial Number,RamModule 1 Size (MB),RamModule 1 Speed (MHz),RamModule 1 Size,RamModule 2,RamModule 2 Manufacturer,RamModule 2 Model,RamModule 2 Serial Number,RamModule 3,RamModule 3 Manufacturer,RamModule 3 Model,RamModule 3 Serial Number,RamModule 4,RamModule 4 Manufacturer,RamModule 4 Model,RamModule 4 Serial Number,SoundCard 1,SoundCard 1 Manufacturer,SoundCard 1 Model,SoundCard 1 Serial Number,SoundCard 2,SoundCard 2 Manufacturer,SoundCard 2 Model,SoundCard 2 Serial Number
Desktop,ComputerChassis.Microtower,,,,d1s,d1ml,d1mr,,Thu Oct 25 10:24:30 2018,p1ml,0,0,0.8,Very low,1.0,Very low,1.0,Very low,1.0,Very low,,,,,,,,,,,,,,,,,,,,,"GraphicCard 2: model gc1ml, S/N gc1s",gc1s,gc1s,gc1s,,,,,,,,,,,,,,,,,,"Processor 4: model p1ml, S/N p1s",p1s,p1s,p1s,,1.6,,,,,"RamModule 3: model rm1ml, S/N rm1s",rm1s,rm1s,rm1s,,1333,,,,,,,,,,,,,,,,,,,,,
Desktop,Microtower,,,,d1s,d1ml,d1mr,,Tue Nov 13 17:20:42 2018,p1ml,0,0,0.8,Very low,1.0,Very low,1.0,Very low,1.0,Very low,,,,,,,,,,,,,,,,,,,,,"GraphicCard 2: model gc1ml, S/N gc1s",gc1s,gc1s,gc1s,,,,,,,,,,,,,,,,,,"Processor 4: model p1ml, S/N p1s",p1s,p1s,p1s,,1.6,,,,,"RamModule 3: model rm1ml, S/N rm1s",rm1s,rm1s,rm1s,,1333,,,,,,,,,,,,,,,,,,,,,

1 Type Chassis Tag 1 Tag 2 Tag 3 Serial Number Model Manufacturer Price Registered in Processor RAM (GB) Storage Size (MB) Rate Range Processor Rate Processor Range RAM Rate RAM Range Data Storage Rate Data Storage Range DataStorage 1 DataStorage 1 Manufacturer DataStorage 1 Model DataStorage 1 Serial Number DataStorage 2 DataStorage 2 Manufacturer DataStorage 2 Model DataStorage 2 Serial Number DataStorage 3 DataStorage 3 Manufacturer DataStorage 3 Model DataStorage 3 Serial Number DataStorage 4 DataStorage 4 Manufacturer DataStorage 4 Model DataStorage 4 Serial Number Display 1 Display 1 Manufacturer Display 1 Model Display 1 Serial Number GraphicCard 1 GraphicCard 1 Manufacturer GraphicCard 1 Model GraphicCard 1 Serial Number GraphicCard 1 Memory (MB) GraphicCard 2 GraphicCard 2 Manufacturer GraphicCard 2 Model GraphicCard 2 Serial Number Motherboard 1 Motherboard 1 Manufacturer Motherboard 1 Model Motherboard 1 Serial Number NetworkAdapter 1 NetworkAdapter 1 Manufacturer NetworkAdapter 1 Model NetworkAdapter 1 Serial Number NetworkAdapter 2 NetworkAdapter 2 Manufacturer NetworkAdapter 2 Model NetworkAdapter 2 Serial Number Processor 1 Processor 1 Manufacturer Processor 1 Model Processor 1 Serial Number Processor 1 Number of cores Processor 1 Speed (GHz) Processor 2 Processor 2 Manufacturer Processor 2 Model Processor 2 Serial Number RamModule 1 RamModule 1 Manufacturer RamModule 1 Model RamModule 1 Serial Number RamModule 1 Size (MB) RamModule 1 Speed (MHz) RamModule 1 Size RamModule 2 RamModule 2 Manufacturer RamModule 2 Model RamModule 2 Serial Number RamModule 3 RamModule 3 Manufacturer RamModule 3 Model RamModule 3 Serial Number RamModule 4 RamModule 4 Manufacturer RamModule 4 Model RamModule 4 Serial Number SoundCard 1 SoundCard 1 Manufacturer SoundCard 1 Model SoundCard 1 Serial Number SoundCard 2 SoundCard 2 Manufacturer SoundCard 2 Model SoundCard 2 Serial Number
2 Desktop ComputerChassis.Microtower Microtower d1s d1ml d1mr Thu Oct 25 10:24:30 2018 Tue Nov 13 17:20:42 2018 p1ml 0 0 0.8 Very low 1.0 Very low 1.0 Very low 1.0 Very low GraphicCard 2: model gc1ml, S/N gc1s gc1s gc1s gc1s Processor 4: model p1ml, S/N p1s p1s p1s p1s 1.6 RamModule 3: model rm1ml, S/N rm1s rm1s rm1s rm1s 1333

View File

@ -1,2 +1,2 @@
Type,Chassis,Tag 1,Tag 2,Tag 3,Serial Number,Model,Manufacturer,Price,Registered in,Processor,RAM (GB),Storage Size (MB),Rate,Range,Processor Rate,Processor Range,RAM Rate,RAM Range,Data Storage Rate,Data Storage Range,DataStorage 1,DataStorage 1 Manufacturer,DataStorage 1 Model,DataStorage 1 Serial Number,DataStorage 2,DataStorage 2 Manufacturer,DataStorage 2 Model,DataStorage 2 Serial Number,DataStorage 3,DataStorage 3 Manufacturer,DataStorage 3 Model,DataStorage 3 Serial Number,DataStorage 4,DataStorage 4 Manufacturer,DataStorage 4 Model,DataStorage 4 Serial Number,Display 1,Display 1 Manufacturer,Display 1 Model,Display 1 Serial Number,GraphicCard 1,GraphicCard 1 Manufacturer,GraphicCard 1 Model,GraphicCard 1 Serial Number,GraphicCard 1 Memory (MB),GraphicCard 2,GraphicCard 2 Manufacturer,GraphicCard 2 Model,GraphicCard 2 Serial Number,Motherboard 1,Motherboard 1 Manufacturer,Motherboard 1 Model,Motherboard 1 Serial Number,Motherboard 1 Slots,NetworkAdapter 1,NetworkAdapter 1 Manufacturer,NetworkAdapter 1 Model,NetworkAdapter 1 Serial Number,NetworkAdapter 2,NetworkAdapter 2 Manufacturer,NetworkAdapter 2 Model,NetworkAdapter 2 Serial Number,Processor 1,Processor 1 Manufacturer,Processor 1 Model,Processor 1 Serial Number,Processor 1 Number of cores,Processor 1 Speed (GHz),Processor 2,Processor 2 Manufacturer,Processor 2 Model,Processor 2 Serial Number,RamModule 1,RamModule 1 Manufacturer,RamModule 1 Model,RamModule 1 Serial Number,RamModule 1 Size (MB),RamModule 1 Speed (MHz),RamModule 1 Size,RamModule 2,RamModule 2 Manufacturer,RamModule 2 Model,RamModule 2 Serial Number,RamModule 3,RamModule 3 Manufacturer,RamModule 3 Model,RamModule 3 Serial Number,RamModule 4,RamModule 4 Manufacturer,RamModule 4 Model,RamModule 4 Serial Number,SoundCard 1,SoundCard 1 Manufacturer,SoundCard 1 Model,SoundCard 1 Serial Number,SoundCard 2,SoundCard 2 Manufacturer,SoundCard 2 Model,SoundCard 2 Serial Number
Laptop,ComputerChassis.Netbook,,,,b8oaas048286,1001pxd,asustek computer inc.,,Thu Oct 25 10:26:02 2018,intel atom cpu n455 @ 1.66ghz,1024,238475,1.73,Very low,1.0,Very low,1.53,Very low,3.76,Medium,,,,,,,,,,,,,,,,,,,,,"GraphicCard 5: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None",,,,256,,,,,"Motherboard 10: model 1001pxd, S/N eee0123456789",eee0123456789,eee0123456789,eee0123456789,2,"NetworkAdapter 2: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c8",74:2f:68:8b:fd:c8,74:2f:68:8b:fd:c8,74:2f:68:8b:fd:c8,"NetworkAdapter 3: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7c",14:da:e9:42:f6:7c,14:da:e9:42:f6:7c,14:da:e9:42:f6:7c,"Processor 4: model intel atom cpu n455 @ 1.66ghz, S/N None",,,,1,1.667,,,,,"RamModule 8: model None, S/N None",,,,1024,667,1024,,,,,,,,,,,,,"SoundCard 6: model nm10/ich7 family high definition audio controller, S/N None",,,,"SoundCard 7: model usb 2.0 uvc vga webcam, S/N 0x0001",0x0001,0x0001,0x0001
Laptop,Netbook,,,,b8oaas048286,1001pxd,asustek computer inc.,,Thu Oct 25 10:26:02 2018,intel atom cpu n455 @ 1.66ghz,1024,238475,1.73,Very low,1.0,Very low,1.53,Very low,3.76,Medium,,,,,,,,,,,,,,,,,,,,,"GraphicCard 5: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None",,,,256,,,,,"Motherboard 10: model 1001pxd, S/N eee0123456789",eee0123456789,eee0123456789,eee0123456789,2,"NetworkAdapter 2: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c8",74:2f:68:8b:fd:c8,74:2f:68:8b:fd:c8,74:2f:68:8b:fd:c8,"NetworkAdapter 3: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7c",14:da:e9:42:f6:7c,14:da:e9:42:f6:7c,14:da:e9:42:f6:7c,"Processor 4: model intel atom cpu n455 @ 1.66ghz, S/N None",,,,1,1.667,,,,,"RamModule 8: model None, S/N None",,,,1024,667,1024,,,,,,,,,,,,,"SoundCard 6: model nm10/ich7 family high definition audio controller, S/N None",,,,"SoundCard 7: model usb 2.0 uvc vga webcam, S/N 0x0001",0x0001,0x0001,0x0001

1 Type Chassis Tag 1 Tag 2 Tag 3 Serial Number Model Manufacturer Price Registered in Processor RAM (GB) Storage Size (MB) Rate Range Processor Rate Processor Range RAM Rate RAM Range Data Storage Rate Data Storage Range DataStorage 1 DataStorage 1 Manufacturer DataStorage 1 Model DataStorage 1 Serial Number DataStorage 2 DataStorage 2 Manufacturer DataStorage 2 Model DataStorage 2 Serial Number DataStorage 3 DataStorage 3 Manufacturer DataStorage 3 Model DataStorage 3 Serial Number DataStorage 4 DataStorage 4 Manufacturer DataStorage 4 Model DataStorage 4 Serial Number Display 1 Display 1 Manufacturer Display 1 Model Display 1 Serial Number GraphicCard 1 GraphicCard 1 Manufacturer GraphicCard 1 Model GraphicCard 1 Serial Number GraphicCard 1 Memory (MB) GraphicCard 2 GraphicCard 2 Manufacturer GraphicCard 2 Model GraphicCard 2 Serial Number Motherboard 1 Motherboard 1 Manufacturer Motherboard 1 Model Motherboard 1 Serial Number Motherboard 1 Slots NetworkAdapter 1 NetworkAdapter 1 Manufacturer NetworkAdapter 1 Model NetworkAdapter 1 Serial Number NetworkAdapter 2 NetworkAdapter 2 Manufacturer NetworkAdapter 2 Model NetworkAdapter 2 Serial Number Processor 1 Processor 1 Manufacturer Processor 1 Model Processor 1 Serial Number Processor 1 Number of cores Processor 1 Speed (GHz) Processor 2 Processor 2 Manufacturer Processor 2 Model Processor 2 Serial Number RamModule 1 RamModule 1 Manufacturer RamModule 1 Model RamModule 1 Serial Number RamModule 1 Size (MB) RamModule 1 Speed (MHz) RamModule 1 Size RamModule 2 RamModule 2 Manufacturer RamModule 2 Model RamModule 2 Serial Number RamModule 3 RamModule 3 Manufacturer RamModule 3 Model RamModule 3 Serial Number RamModule 4 RamModule 4 Manufacturer RamModule 4 Model RamModule 4 Serial Number SoundCard 1 SoundCard 1 Manufacturer SoundCard 1 Model SoundCard 1 Serial Number SoundCard 2 SoundCard 2 Manufacturer SoundCard 2 Model SoundCard 2 Serial Number
2 Laptop ComputerChassis.Netbook Netbook b8oaas048286 1001pxd asustek computer inc. Thu Oct 25 10:26:02 2018 intel atom cpu n455 @ 1.66ghz 1024 238475 1.73 Very low 1.0 Very low 1.53 Very low 3.76 Medium GraphicCard 5: model atom processor d4xx/d5xx/n4xx/n5xx integrated graphics controller, S/N None 256 Motherboard 10: model 1001pxd, S/N eee0123456789 eee0123456789 eee0123456789 eee0123456789 2 NetworkAdapter 2: model ar9285 wireless network adapter, S/N 74:2f:68:8b:fd:c8 74:2f:68:8b:fd:c8 74:2f:68:8b:fd:c8 74:2f:68:8b:fd:c8 NetworkAdapter 3: model ar8152 v2.0 fast ethernet, S/N 14:da:e9:42:f6:7c 14:da:e9:42:f6:7c 14:da:e9:42:f6:7c 14:da:e9:42:f6:7c Processor 4: model intel atom cpu n455 @ 1.66ghz, S/N None 1 1.667 RamModule 8: model None, S/N None 1024 667 1024 SoundCard 6: model nm10/ich7 family high definition audio controller, S/N None SoundCard 7: model usb 2.0 uvc vga webcam, S/N 0x0001 0x0001 0x0001 0x0001