MCPcopy Create free account
hub / github.com/encode/django-rest-framework / setUp

Method setUp

tests/test_routers.py:257–265  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

255 to the viewset.
256 """
257 def setUp(self):
258 class NoteViewSet(viewsets.ModelViewSet):
259 queryset = RouterTestModel.objects.all()
260 lookup_field = 'uuid'
261 lookup_value_regex = '[0-9a-f]{32}'
262
263 self.router = SimpleRouter()
264 self.router.register(r'notes', NoteViewSet)
265 self.urls = self.router.urls
266
267 def test_urls_limited_by_lookup_value_regex(self):
268 expected = ['^notes/$', '^notes/(?P<uuid>[0-9a-f]{32})/$']

Callers

nothing calls this directly

Calls 2

SimpleRouterClass · 0.90
registerMethod · 0.80

Tested by

no test coverage detected