Refactored unit test to delete before saving and flush after saving in
hopes it will fix the randomly failing test that only occurs on Bamboo
CI.