mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
reverse URL lookup for BomItem and SupplierPart
- created empty test files
This commit is contained in:
parent
0bc5617825
commit
e6617fef80
@ -337,7 +337,7 @@ class BomItem(models.Model):
|
||||
"""
|
||||
|
||||
def get_absolute_url(self):
|
||||
return '/part/bom/{id}/'.format(id=self.id)
|
||||
return reverse('bom-detail', kwargs={'pk': self.id})
|
||||
|
||||
# A link to the parent part
|
||||
# Each part will get a reverse lookup field 'bom_items'
|
||||
@ -386,7 +386,7 @@ class SupplierPart(models.Model):
|
||||
"""
|
||||
|
||||
def get_absolute_url(self):
|
||||
return "/supplier-part/{id}/".format(id=self.id)
|
||||
return reverse('supplier-part-detail', kwargs={'pk': self.id})
|
||||
|
||||
class Meta:
|
||||
unique_together = ('part', 'supplier', 'SKU')
|
||||
|
10
InvenTree/part/test_bom_item.py
Normal file
10
InvenTree/part/test_bom_item.py
Normal file
@ -0,0 +1,10 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from .models import Part, BomItem
|
||||
|
||||
|
||||
class BomItemTest(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
9
InvenTree/part/test_supplier_part.py
Normal file
9
InvenTree/part/test_supplier_part.py
Normal file
@ -0,0 +1,9 @@
|
||||
from django.test import TestCase
|
||||
|
||||
from .models import Part, SupplierPart
|
||||
|
||||
|
||||
class SupplierPartTest(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
pass
|
Loading…
Reference in New Issue
Block a user