mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-06 05:30:56 +00:00
Label printing unit test (#3047)
* Adds a very simple sample plugin for label printing * Test mixin install status and API query * Better error reporting for label printing API * pep fixes * fix assertation * remove broken assertation * igonre for coverage * test the base process of printing * refactor tests * clean up basic test * refactor url * fix url creation * test printing multiples * test all printing endpoints * test all list options - move api tests * test for invalid filters * refactor * test with no part * these should not happen checks are in place upstream * fix assertation * do not cover continue parts * test for wrong implementation * ignore DB not ready * remove covage from default parts * fix url generation * test debug mode * fix url assertation * check that nothing was rendered Co-authored-by: Oliver Walters <oliver.henry.walters@gmail.com>
This commit is contained in:
@ -26,13 +26,13 @@ def print_label(plugin_slug, label_image, label_instance=None, user=None):
|
||||
|
||||
plugin = registry.plugins.get(plugin_slug, None)
|
||||
|
||||
if plugin is None:
|
||||
if plugin is None: # pragma: no cover
|
||||
logger.error(f"Could not find matching plugin for '{plugin_slug}'")
|
||||
return
|
||||
|
||||
try:
|
||||
plugin.print_label(label_image, width=label_instance.width, height=label_instance.height)
|
||||
except Exception as e:
|
||||
except Exception as e: # pragma: no cover
|
||||
# Plugin threw an error - notify the user who attempted to print
|
||||
|
||||
ctx = {
|
||||
|
Reference in New Issue
Block a user