It was in potions class. They had to have partners, but you have to have a Gryffindor and a Slytherin in a group. Seeing as this was the perfect opportunity Snape put Draco and Harry together. Snape assigned potions to study. Snape assigned Amortentia to the darco and harry.