1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixes #3452: Queue deletion ObjectChanges until after response is sent

This commit is contained in:
Jeremy Stretch
2019-08-26 16:52:05 -04:00
parent 03ac2721bc
commit 6e66f8d68a
8 changed files with 77 additions and 106 deletions

View File

@@ -35,9 +35,9 @@ class TaggedItemTest(APITestCase):
site = Site.objects.create(
name='Test Site',
slug='test-site',
tags=['Foo', 'Bar', 'Baz']
slug='test-site'
)
site.tags.add('Foo', 'Bar', 'Baz')
data = {
'tags': ['Foo', 'Bar', 'New Tag']

View File

@@ -6,6 +6,7 @@ from django.test import Client, TestCase
from django.urls import reverse
from dcim.models import Site
from extras.constants import OBJECTCHANGE_ACTION_UPDATE
from extras.models import ConfigContext, ObjectChange, Tag
from utilities.testing import create_test_user
@@ -82,11 +83,10 @@ class ObjectChangeTestCase(TestCase):
# Create three ObjectChanges
for i in range(1, 4):
site.log_change(
user=user,
request_id=uuid.uuid4(),
action=2
)
oc = site.to_objectchange(action=OBJECTCHANGE_ACTION_UPDATE)
oc.user = user
oc.request_id = uuid.uuid4()
oc.save()
def test_objectchange_list(self):