|
|
@@ -180,6 +180,15 @@ class LineTests(TestCase):
|
|
180
|
180
|
# Total quantity is too high
|
|
181
|
181
|
self.event(type, 2)
|
|
182
|
182
|
|
|
|
183
|
+ def test_handles_product_deletion_gracefully(self):
|
|
|
184
|
+ product = self.line.product
|
|
|
185
|
+ product.delete()
|
|
|
186
|
+ line = Line.objects.get(pk=self.line.pk)
|
|
|
187
|
+ self.assertIsNone(line.product)
|
|
|
188
|
+ self.assertIsNone(line.stockrecord)
|
|
|
189
|
+ self.assertEqual(product.title, line.title)
|
|
|
190
|
+ self.assertEqual(product.upc, line.upc)
|
|
|
191
|
+
|
|
183
|
192
|
|
|
184
|
193
|
class LineStatusTests(TestCase):
|
|
185
|
194
|
|