webcompat / webcompat.com

Source code for webcompat.com
https://webcompat.com
360 stars 191 forks source link

[optimization] Make the extra label tests independent from EXTRA_LABEL #2053

Open karlcow opened 6 years ago

karlcow commented 6 years ago

Triggered by the discussion in https://github.com/webcompat/webcompat.com/pull/2052#issuecomment-363646258

Currently the form tests depend on the authorized values in EXTRA_LABEL

https://github.com/webcompat/webcompat.com/blob/4e9568c3591626007b369a64bbea4d680eea7d1a/tests/unit/test_form.py#L127-L144

from config

https://github.com/webcompat/webcompat.com/blob/4e9568c3591626007b369a64bbea4d680eea7d1a/config/__init__.py#L137-L144

This should not. We want to test that we can have an EXTRA_LABEL list and that it is failing or succeed in case the value is not in EXTRA_LABEL but we do not want to be dependent of this each time we change the value to be something else.

So we need to locally redefine EXTRA_LABEL in the tests.

miketaylr commented 6 years ago

So we need to locally redefine EXTRA_LABEL in the tests.

Yeah.