'Verify that team count is scoped within a course.'

def test_scoped_within_course(self):

    duplicate_topic = self.course.teams_topics[0]
    second_course = CourseFactory.create(teams_configuration={'max_team_size': 10, 'topics': [duplicate_topic]})
    CourseTeamFactory.create(course_id=self.course.id, topic_id=duplicate_topic[u'id'])
    CourseTeamFactory.create(course_id=second_course.id, topic_id=duplicate_topic[u'id'])
    with self.assertNumQueries(1):
        serializer = TopicSerializer(self.course.teams_topics[0], context={'course_id': self.course.id})
        self.assertEqual(serializer.data, {u'name': u'T\xf8pic', u'description': u'The    b\xe9st    topic!', u'id': u'0', u'team_count': 1})
