'First regression test for
https://github.com/spacetelescope/PyFITS/issues/37
Although test_assign_unicode ensures that Python 2 `unicode` objects
and Python 3 `str` objects containing non-ASCII characters cannot be
assigned to headers, there is a bug that allows Python 2 `str` objects
of arbitrary encoding containing non-ASCII characters to be passed
through.
On Python 3 it should not be possible to assign bytes to a header at
all.'

def test_assign_non_ascii(self):

    h = fits.Header()
    if six.PY2:
        pytest.raises(ValueError, h.set, 'TEST', str('\xc3\xb1'))
    else:
        pytest.raises(ValueError, h.set, 'TEST', bytes('Hello', encoding='ascii'))
