mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 19:08:38 -06:00
Add URL test case for regular models
This commit is contained in:
parent
1f07b07bf7
commit
8b0af50019
@ -1,10 +1,17 @@
|
|||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
||||||
|
from core.models import ObjectChange
|
||||||
from netbox.tests.dummy_plugin.models import DummyModel
|
from netbox.tests.dummy_plugin.models import DummyModel
|
||||||
|
|
||||||
|
|
||||||
class ModelTest(TestCase):
|
class ModelTest(TestCase):
|
||||||
|
|
||||||
|
def test_get_absolute_url(self):
|
||||||
|
m = ObjectChange()
|
||||||
|
m.pk = 123
|
||||||
|
|
||||||
|
self.assertEqual(m.get_absolute_url(), f'/core/changelog/{m.pk}/')
|
||||||
|
|
||||||
def test_absolute_url(self):
|
def test_absolute_url(self):
|
||||||
m = DummyModel(name='Foo')
|
m = DummyModel(name='Foo')
|
||||||
m.full_clean()
|
m.full_clean()
|
||||||
|
Loading…
Reference in New Issue
Block a user