def test_cannot_see_non_friends_character(self): """ Should not be able to see a non-friend's friends-ony character in a listing. """ db_utils.create_character(self.user2, settings=CharSettings({"friends-only"}, {}, {})) self.assertEqual( self.count, character.select_count(self.user1, ratings.GENERAL.code))
def test_see_friends_character(self): """ Should be able to see a friend's friends-only character in a listing. """ c = db_utils.create_character(self.friend1, settings=CharSettings({"friends-only"}, {}, {})) self.assertEqual( self.count + 1, character.select_count(self.user1, ratings.GENERAL.code)) self.assertEqual( c, character.select_list(self.user1, ratings.GENERAL.code, 100)[0]['charid'])
def test_count_nextid(self): self.assertEqual( self.pivot, character.select_count(self.user1, ratings.GENERAL.code, nextid=self.pivotid))
def test_count_backid(self): self.assertEqual( self.count - self.pivot - 1, character.select_count(self.user1, ratings.GENERAL.code, backid=self.pivotid))