Add trailing slash to accept/reject API URLs fixes #278
This commit is contained in:
Родитель
3bc3f79879
Коммит
5ac86129a3
|
@ -14,12 +14,12 @@ urlpatterns = [
|
|||
name='experiments-list',
|
||||
),
|
||||
url(
|
||||
r'^(?P<slug>[\w-]+)/accept$',
|
||||
r'^(?P<slug>[\w-]+)/accept/$',
|
||||
ExperimentAcceptView.as_view(),
|
||||
name='experiments-accept',
|
||||
),
|
||||
url(
|
||||
r'^(?P<slug>[\w-]+)/reject$',
|
||||
r'^(?P<slug>[\w-]+)/reject/$',
|
||||
ExperimentRejectView.as_view(),
|
||||
name='experiments-reject',
|
||||
),
|
||||
|
|
|
@ -154,6 +154,20 @@ class TestExperimentModel(TestCase):
|
|||
'&metrics=ALL&next=%2F&pop=ALL&scale=linear&showOutliers=false'),
|
||||
)
|
||||
|
||||
def test_accept_url_is_correct(self):
|
||||
experiment = ExperimentFactory.create(slug='experiment')
|
||||
self.assertEqual(
|
||||
experiment.accept_url,
|
||||
'https://localhost/api/v1/experiments/experiment/accept/',
|
||||
)
|
||||
|
||||
def test_reject_url_is_correct(self):
|
||||
experiment = ExperimentFactory.create(slug='experiment')
|
||||
self.assertEqual(
|
||||
experiment.reject_url,
|
||||
'https://localhost/api/v1/experiments/experiment/reject/',
|
||||
)
|
||||
|
||||
|
||||
class TestExperimentChangeLogManager(TestCase):
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче