Django Test Suite URL Coverage

后端 未结 2 466
感情败类
感情败类 2021-01-12 20:59

I\'d like to make sure that my Django test suite covers all URLs listed in my URL configuration. Is there a way to compare the list in the URL configuration to a list of URL

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-12 21:33

    I was able to come up with a solution by defining a custom test suite runner that records the URLs being accessed and compares it to the list of configured URLs.

    Here's the code: http://djangosnippets.org/snippets/2694/

提交回复
热议问题