Add unit test for #12813
- [x] closes #12813
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

The bug was already fixed with my previous PR but this adds a fixture to a unit test to also test read-only arrays as factorize input.
thank you sir! https://github.com/pandas-dev/pandas/commit/be2a9f8bbe4d42b8111db0cbcc466f619b0cce3a

if you are so inclined, pretty much can reverse this.