Avoid app crash if settings does not have TEST_MODE

@mattdrayer checking if `TEST_MODE` is present in settings before using it.