[TST] : Adding test cases to confirm that .apply() works fine
Adding test cases for closure of issue  :  Unexpected behaviour of apply function 

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