##// END OF EJS Templates
Fixed tests to use the new settings
neko259 -
r1154:d3095827 default
parent child Browse files
Show More
@@ -91,26 +91,26 b' class PostTests(TestCase):'
91 def test_thread_max_count(self):
91 def test_thread_max_count(self):
92 """Test deletion of old posts when the max thread count is reached"""
92 """Test deletion of old posts when the max thread count is reached"""
93
93
94 for i in range(settings.MAX_THREAD_COUNT + 1):
94 for i in range(settings.get_int('Messages', 'MaxThreadCount') + 1):
95 self._create_post()
95 self._create_post()
96
96
97 self.assertEqual(settings.MAX_THREAD_COUNT,
97 self.assertEqual(settings.get_int('Messages', 'MaxThreadCount'),
98 len(Thread.objects.filter(archived=False)))
98 len(Thread.objects.filter(archived=False)))
99
99
100 def test_pages(self):
100 def test_pages(self):
101 """Test that the thread list is properly split into pages"""
101 """Test that the thread list is properly split into pages"""
102
102
103 for i in range(settings.MAX_THREAD_COUNT):
103 for i in range(settings.get_int('Messages', 'MaxThreadCount')):
104 self._create_post()
104 self._create_post()
105
105
106 all_threads = Thread.objects.filter(archived=False)
106 all_threads = Thread.objects.filter(archived=False)
107
107
108 paginator = Paginator(Thread.objects.filter(archived=False),
108 paginator = Paginator(Thread.objects.filter(archived=False),
109 settings.THREADS_PER_PAGE)
109 settings.get_int('View', 'ThreadsPerPage'))
110 posts_in_second_page = paginator.page(2).object_list
110 posts_in_second_page = paginator.page(2).object_list
111 first_post = posts_in_second_page[0]
111 first_post = posts_in_second_page[0]
112
112
113 self.assertEqual(all_threads[settings.THREADS_PER_PAGE].id,
113 self.assertEqual(all_threads[settings.get_int('View', 'ThreadsPerPage')].id,
114 first_post.id)
114 first_post.id)
115
115
116 def test_thread_replies(self):
116 def test_thread_replies(self):
General Comments 0
You need to be logged in to leave comments. Login now