Unit test and runtime behaviour of controller differ

Sorry, that was the wrong paste

So if I understand your comment correctly, it’s not using the correct primary key? I’m just very confused about why these three test cases aren’t working as expected, but they are the same as the other model/controller I have set up.

thanks for the help so far though