Skip to content

Commit 2d35cf2

Browse files
Additional unit testing
1 parent c005ef8 commit 2d35cf2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/test_build.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from test_api import InvenTreeTestCase # noqa: E402
1313

1414
from inventree.base import Attachment # noqa: E402
15-
from inventree.build import Build # noqa: E402
15+
from inventree.build import Build, BuildLine # noqa: E402
1616

1717

1818
class BuildOrderTest(InvenTreeTestCase):
@@ -144,3 +144,16 @@ def test_build_complete(self):
144144
# Check status
145145
self.assertEqual(build.status, 40)
146146
self.assertEqual(build.status_text, 'Complete')
147+
148+
def test_build_lines(self):
149+
""" Test retrieval of build line items. """
150+
151+
build = self.get_build()
152+
153+
lines = build.getLines()
154+
155+
self.assertGreater(len(lines), 0)
156+
157+
for line in lines:
158+
self.assertEqual(line.build, build.pk)
159+
self.assertIsInstance(line, BuildLine)

0 commit comments

Comments
 (0)