0👍
Turns out that the regex I was using while running the tests was slightly different to the one I posted in the question – I hadn’t reloaded my instance, and it was using the old regex I had been using: (?P<code>[\w:-_]+)
. The correct regex is (?P<code>[\w:-]+)
– the :-_
makes the regex match the range from : to _ but doesn’t include the hyphen itself. The correct regex has they hyphen at the end of the set, so it is treated just as a hyphen character. Since the \w
includes an underscore, the underscore is not necessary, but (?P<code>[\w:_-]+)
would also be a correct regex.
Thanks to @fasouto for pointing me in the right direction!
- [Django]-Fake subfunction in django UnitTest Case (Mocking)
- [Django]-Command not found: django-admin (using anaconda 3.2.4 and pyenv)
- [Django]-Getting task_ids for all tasks created with celery chord
Source:stackexchange.com