Fixed #10461 -- bug in generic relation + annotate() case

This issue was fixed when the contenttype restriction was moved from
where clause to the join clause. So, this is tests only addition.