mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Add fixtures to the part test
- Make development of further tests much easier
This commit is contained in:
		
							
								
								
									
										56
									
								
								InvenTree/part/fixtures/category.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								InvenTree/part/fixtures/category.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,56 @@
 | 
			
		||||
# Create some PartCategory objects
 | 
			
		||||
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 1
 | 
			
		||||
  fields:
 | 
			
		||||
    name: Electronics
 | 
			
		||||
    description: Electronic components
 | 
			
		||||
    parent: null
 | 
			
		||||
    default_location: null
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 2
 | 
			
		||||
  fields:
 | 
			
		||||
    name: Resistors
 | 
			
		||||
    description: Resistors
 | 
			
		||||
    parent: 1
 | 
			
		||||
    default_location: null
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 3
 | 
			
		||||
  fields:
 | 
			
		||||
    name: Capacitors
 | 
			
		||||
    description: Capacitors
 | 
			
		||||
    parent: 1
 | 
			
		||||
    default_location: null
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 4
 | 
			
		||||
  fields:
 | 
			
		||||
    name: IC
 | 
			
		||||
    description: Integrated Circuits
 | 
			
		||||
    parent: 1
 | 
			
		||||
    default_location: null
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 5
 | 
			
		||||
  fields:
 | 
			
		||||
    name: MCU
 | 
			
		||||
    description: Microcontrollers
 | 
			
		||||
    parent: 4
 | 
			
		||||
    default_location: null
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 6
 | 
			
		||||
  fields:
 | 
			
		||||
    name: Transceivers
 | 
			
		||||
    description: Communication interfaces
 | 
			
		||||
    parent: 4
 | 
			
		||||
    default_location: null
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 7
 | 
			
		||||
  fields:
 | 
			
		||||
    name: Mechanical
 | 
			
		||||
    description: Mechanical componenets
 | 
			
		||||
    default_location: null
 | 
			
		||||
- model: part.partcategory
 | 
			
		||||
  pk: 8
 | 
			
		||||
  fields:
 | 
			
		||||
    name: Fasteners
 | 
			
		||||
    description: Screws, bolts, etc
 | 
			
		||||
    parent: 7
 | 
			
		||||
							
								
								
									
										32
									
								
								InvenTree/part/fixtures/part.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								InvenTree/part/fixtures/part.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
# Create some fasteners 
 | 
			
		||||
 | 
			
		||||
- model: part.part
 | 
			
		||||
  fields:
 | 
			
		||||
    name: 'M2x4 LPHS'
 | 
			
		||||
    description: 'M2x4 low profile head screw'
 | 
			
		||||
    category: 8
 | 
			
		||||
- model: part.part
 | 
			
		||||
  fields:
 | 
			
		||||
    name: 'M3x12 SHCS'
 | 
			
		||||
    description: 'M3x12 socket head cap screw'
 | 
			
		||||
    category: 8
 | 
			
		||||
 | 
			
		||||
# Create some resistors
 | 
			
		||||
 | 
			
		||||
- model: part.part
 | 
			
		||||
  fields:
 | 
			
		||||
    name: 'R_2K2_0805'
 | 
			
		||||
    description: '2.2kOhm resistor in 0805 package'
 | 
			
		||||
    category: 2
 | 
			
		||||
- model: part.part
 | 
			
		||||
  fields:
 | 
			
		||||
    name: 'R_4K7_0603'
 | 
			
		||||
    description: '4.7kOhm resistor in 0603 package'
 | 
			
		||||
    category: 2
 | 
			
		||||
 | 
			
		||||
# Create some capacitors
 | 
			
		||||
- model: part.part
 | 
			
		||||
  fields:
 | 
			
		||||
    name: 'C_22N_0805'
 | 
			
		||||
    description: '22nF capacitor in 0805 package'
 | 
			
		||||
    category: 3
 | 
			
		||||
		Reference in New Issue
	
	Block a user