2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Reverse lookup for company URL

- Added some simple tests
This commit is contained in:
Oliver Walters
2019-04-24 23:55:11 +10:00
parent 5098712d9c
commit a2d4403968
2 changed files with 20 additions and 3 deletions

View File

@ -1,3 +1,19 @@
# from django.test import TestCase
from django.test import TestCase
# Create your tests here.
from .models import Company
class CompanySimpleTest(TestCase):
def setUp(self):
Company.objects.create(name='ABC Co.',
description='Seller of ABC products',
website='www.abc-sales.com',
address='123 Sales St.',
is_customer=False,
is_supplier=True)
def test_company_model(self):
c = Company.objects.get(pk=1)
self.assertEqual(c.name, 'ABC Co.')
self.assertEqual(c.get_absolute_url(), '/company/1/')