core: make sure base_data is bytes or Pdata

This was working fine (although not python3 ready), but was not tested
2 jobs for fix/test_base_data in 0 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-TestRunner3

00:40:37

failed ERP5.UnitTest-TestRunner3

01:38:18