'Ensure that the secondary sort (alphabetical) when primary sort is team_count
works across pagination boundaries.'

def test_order_by_team_count_secondary(self):

    with skip_signal(post_save, receiver=course_team_post_save_callback, sender=CourseTeam, dispatch_uid='teams.signals.course_team_post_save_callback'):
        CourseTeamFactory.create(name=u'Wind    Team    1', course_id=self.test_course_1.id, topic_id='topic_1')
        CourseTeamFactory.create(name=u'Wind    Team    2', course_id=self.test_course_1.id, topic_id='topic_1')
    topics = self.get_topics_list(data={'course_id': self.test_course_1.id, 'page_size': 2, 'page': 1, 'order_by': 'team_count'})
    self.assertEqual(['Wind    Power', u'S\xf3lar    power'], [topic['name'] for topic in topics['results']])
    topics = self.get_topics_list(data={'course_id': self.test_course_1.id, 'page_size': 2, 'page': 2, 'order_by': 'team_count'})
    self.assertEqual(['Coal    Power', 'Nuclear    Power'], [topic['name'] for topic in topics['results']])
