oq-ui-api/geonode/exposure/views.py:

Moved csv header and nrml header, footer, and asset template to
constants at the top of the module. Refactored generator code
accordingly.
oq-ui-api/geonode/exposure/views.py:

Changed raise exception types from `RuntimeError` to `ValueError`.
oq-ui-api/geonode/exposure/views.py:

Raise an error if the 'residential' selection is invalid.
oq-ui-api/geonode/exposure/tests.py:

Adjusted tests to match the new exception type thrown by the code.
oq-ui-api/geonode/exposure/tests.py:

Added a bunch of tests to StreamResponseGeneratorTestCase.