CLN: Clean _test_moments_consistency in common.py
- [ ] xref #30486 #30542 
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
