From 563cd1d3f5022fefa74b5cb0339f2c98ba0f7645 Mon Sep 17 00:00:00 2001 From: Robert Martin Date: Thu, 23 May 2013 15:23:08 -0400 Subject: remove key restriction in test. At this point in the test, there should only be one `Thread` object. However, because of previous tests, MySQL does not necessarily give that object id=1. By not specifying the id, the test does the intended thing. The get() function will fail if more than one object matches, so the test will still barf if more than one Thread object exists. --- askbot/tests/question_views_tests.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/askbot/tests/question_views_tests.py b/askbot/tests/question_views_tests.py index 9486b854..da3e081d 100644 --- a/askbot/tests/question_views_tests.py +++ b/askbot/tests/question_views_tests.py @@ -33,7 +33,7 @@ class PrivateQuestionViewsTests(AskbotTestCase): dom = BeautifulSoup(response2.content) title = dom.find('h1').text self.assertTrue(unicode(const.POST_STATUS['private']) in title) - question = models.Thread.objects.get(id=1) + question = models.Thread.objects.get() self.assertEqual(question.title, self.qdata['title']) self.assertFalse(models.Group.objects.get_global_group() in set(question.groups.all())) @@ -114,7 +114,7 @@ class PrivateQuestionViewsTests(AskbotTestCase): class PrivateAnswerViewsTests(AskbotTestCase): - + def setUp(self): self._backup = askbot_settings.GROUPS_ENABLED askbot_settings.update('GROUPS_ENABLED', True) @@ -147,7 +147,6 @@ class PrivateAnswerViewsTests(AskbotTestCase): response = self.client.get(self.question.get_absolute_url()) self.assertFalse('some answer text' in response.content) - def test_private_checkbox_is_on_when_editing_private_answer(self): answer = self.post_answer( question=self.question, user=self.user, is_private=True -- cgit v1.2.3-1-g7c22