Add base method to create context
Fix issues when running beatrix tests