# HG changeset patch # User neko259 # Date 2015-05-07 15:38:00 # Node ID d309582731d1a344e413dd31822f0ab989d8a335 # Parent bbf2916ccfe5ee3c387208ce83ad114a85da84db Fixed tests to use the new settings diff --git a/boards/tests/test_post.py b/boards/tests/test_post.py --- a/boards/tests/test_post.py +++ b/boards/tests/test_post.py @@ -91,26 +91,26 @@ class PostTests(TestCase): def test_thread_max_count(self): """Test deletion of old posts when the max thread count is reached""" - for i in range(settings.MAX_THREAD_COUNT + 1): + for i in range(settings.get_int('Messages', 'MaxThreadCount') + 1): self._create_post() - self.assertEqual(settings.MAX_THREAD_COUNT, + self.assertEqual(settings.get_int('Messages', 'MaxThreadCount'), len(Thread.objects.filter(archived=False))) def test_pages(self): """Test that the thread list is properly split into pages""" - for i in range(settings.MAX_THREAD_COUNT): + for i in range(settings.get_int('Messages', 'MaxThreadCount')): self._create_post() all_threads = Thread.objects.filter(archived=False) paginator = Paginator(Thread.objects.filter(archived=False), - settings.THREADS_PER_PAGE) + settings.get_int('View', 'ThreadsPerPage')) posts_in_second_page = paginator.page(2).object_list first_post = posts_in_second_page[0] - self.assertEqual(all_threads[settings.THREADS_PER_PAGE].id, + self.assertEqual(all_threads[settings.get_int('View', 'ThreadsPerPage')].id, first_post.id) def test_thread_replies(self):