mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 17:39:48 +03:00
Fix #6007, and fix test_schemas.TestURLNamingCollisions.test_from_router() assertion
This commit is contained in:
parent
02376b3aab
commit
6079fe7be5
|
@ -85,6 +85,9 @@ def insert_into(target, keys, value):
|
||||||
target = target[key]
|
target = target[key]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
if len(keys) == 1:
|
||||||
|
target[keys[-1]] = LinkNode()
|
||||||
|
target = target[keys[-1]]
|
||||||
target.links.append((keys[-1], value))
|
target.links.append((keys[-1], value))
|
||||||
except TypeError:
|
except TypeError:
|
||||||
msg = INSERT_INTO_COLLISION_FMT.format(
|
msg = INSERT_INTO_COLLISION_FMT.format(
|
||||||
|
|
|
@ -1204,7 +1204,7 @@ class TestURLNamingCollisions(TestCase):
|
||||||
|
|
||||||
# not important here
|
# not important here
|
||||||
desc_0 = schema['detail']['detail_export'].description
|
desc_0 = schema['detail']['detail_export'].description
|
||||||
desc_1 = schema['detail_0'].description
|
desc_1 = schema['detail']['detail'].description
|
||||||
|
|
||||||
expected = coreapi.Document(
|
expected = coreapi.Document(
|
||||||
url='',
|
url='',
|
||||||
|
@ -1214,13 +1214,13 @@ class TestURLNamingCollisions(TestCase):
|
||||||
'detail_export': coreapi.Link(
|
'detail_export': coreapi.Link(
|
||||||
url='/from-routercollision/detail/export/',
|
url='/from-routercollision/detail/export/',
|
||||||
action='get',
|
action='get',
|
||||||
description=desc_0)
|
description=desc_0),
|
||||||
},
|
'detail': coreapi.Link(
|
||||||
'detail_0': coreapi.Link(
|
url='/from-routercollision/detail/',
|
||||||
url='/from-routercollision/detail/',
|
action='get',
|
||||||
action='get',
|
description=desc_1
|
||||||
description=desc_1
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user