[IMP] Add a Raw ZPL2 component

This commit is contained in:
Florent de Labarre
2018-01-23 09:38:50 +01:00
parent 78fb500561
commit 1d11fb18c4
4 changed files with 41 additions and 7 deletions

View File

@@ -1068,3 +1068,22 @@ class TestPrintingLabelZpl2(TransactionCase):
"^JUR\n"
"^XZ")
def test_zpl2_raw_contents_blank(self):
""" Check contents of a image label """
label = self.new_label()
data = '^FO50,50^GB100,100,100^FS'
self.new_component({
'label_id': label.id,
'component_type': 'zpl2_raw',
'data': '"' + data + '"',
})
contents = label._generate_zpl2_data(self.printer).decode("utf-8")
self.assertEqual(
contents,
'^XA\n'
'^PW480\n'
'^CI28\n'
'^LH10,10\n'
'^FO50,50^GB100,100,100^FS\n'
'^JUR\n'
'^XZ')