mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 10:05:39 +00:00
[WIP] Test result table (#6430)
* Add basic table for stock item test results * Improve custom data formatter callback * Custom data formatter for returned results * Update YesNoButton functionality - Add PassFailButton with custom text * Enhancements for stock item test result table - Render all data * Add placeholder row actions * Fix table link * Add option to filter parttesttemplate table by "inherited" * Navigate through to parent part * Update PartTestTemplate model - Save 'key' value to database - Update whenever model is saved - Custom data migration * Custom migration step in tasks.py - Add custom management command - Wraps migration step in maintenance mode * Improve uniqueness validation for PartTestTemplate * Add 'template' field to StockItemTestResult - Links to a PartTestTemplate instance - Add migrations to link existing PartTestTemplates * Add "results" count to PartTestTemplate API - Include in rendered tables * Add 'results' column to test result table - Allow filtering too * Update serializer for StockItemTestResult - Include template information - Update CUI and PUI tables * Control template_detail field with query params * Update ref in api_version.py * Update data migration - Ensure new template is created for top level assembly * Fix admin integration * Update StockItemTestResult table - Remove 'test' field - Make 'template' field non-nullable - Previous data migrations should have accounted for this * Implement "legacy" API support - Create test result by providing test name - Lookup existing template * PUI: Cleanup table * Update tasks.py - Exclude temporary settings when exporting data * Fix unique validation check * Remove duplicate code * CUI: Fix data rendering * More refactoring of PUI table * More fixes for PUI table * Get row expansion working (kinda) * Improve rendering of subtable * More PUI updates: - Edit existing results - Add new results * allow delete of test result * Fix typo * Updates for admin integration * Unit tests for stock migrations * Added migration test for PartTestTemplate * Fix for AttachmentTable - Rebuild actions when permissions are recalculated * Update test fixtures * Add ModelType information * Fix TableState * Fix dataFormatter type def * Improve table rendering * Correctly filter "edit" and "delete" buttons * Loosen requirements for dataFormatter * Fixtures for report tests * Better API filtering for StocokItemTestResult list - Add Filter class - Add option for filtering against legacy "name" data * Cleanup API filter * Fix unit tests * Further unit test fixes * Include test results for installed stock items * Improve rendering of test result table * Fix filtering for getTestResults * More unit test fixes * Fix more unit tests * FIx part unit test * More fixes * More unit test fixes * Rebuild stock item trees when merging * Helper function for adding a test result to a stock item * Set init fix * Code cleanup * Cleanup unused variables * Add docs and more unit tests * Update build unit test
This commit is contained in:
@ -20,7 +20,22 @@ Test templates "cascade" down to variant parts: this means that if a master part
|
||||
|
||||
The name of the test is a simple string value which defines the name of the test. This test must be unique for a given part (or across a set of part variants).
|
||||
|
||||
The test name is used to generate a test "key" which is then used to match against test results associated with individual stock items.
|
||||
#### Test Key
|
||||
|
||||
The test name is used to generate a test "key" which is then used to match against test results associated with individual stock items. The *key* is a simplified string representation of the test name, which consists only of lowercase alphanumeric characters. This key value is automatically generated (based on the test name) whenever the test template is saved.
|
||||
|
||||
The generated test key is intended to be a valid python variable name, and can be used to reference the test in the report generation system.
|
||||
|
||||
##### Examples
|
||||
|
||||
Some examples of generated test key values are provided below:
|
||||
|
||||
| Test Name | Test Key |
|
||||
| --- | --- |
|
||||
| "Firmware Version" | "firmwareversion" |
|
||||
| " My NEW T E sT " | "mynewtest" |
|
||||
| "100 Percent Test"| "_100percenttest" *(note that the leading underscore is added to ensure the key is a valid python variable name)* |
|
||||
| "Test 123" | "test123" |
|
||||
|
||||
#### Test Description
|
||||
|
||||
|
@ -14,9 +14,9 @@ The master "Part" record for the stock item can define multiple [test templates]
|
||||
|
||||
### Test Result Fields
|
||||
|
||||
#### Test Name
|
||||
#### Test Template
|
||||
|
||||
The name of the test data is used to associate the test with a test template object.
|
||||
The *template* field links to a [Part Test Template](../part/test.md#part-test-templates) object. Each test result instance must link to a test template.
|
||||
|
||||
#### Result
|
||||
|
||||
|
Reference in New Issue
Block a user