From 0eff34260404622e332337cb9263e2ec8238d054 Mon Sep 17 00:00:00 2001 From: CKW Date: Sat, 16 May 2015 23:12:58 -0700 Subject: [PATCH] test hide second push --- flashcards/tests/test_api.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/flashcards/tests/test_api.py b/flashcards/tests/test_api.py index 2901f56..b4a03cb 100644 --- a/flashcards/tests/test_api.py +++ b/flashcards/tests/test_api.py @@ -280,4 +280,20 @@ class SectionViewSetTest(APITestCase): response = self.client.get('/api/sections/1/ordered_deck/') self.assertEqual(response.status_code, HTTP_200_OK) - def test_hide_card(self): + +class FlashcardViewSetTest(APITestCase): + fixtures = ['testusers', 'testsections'] + + def setUp(self): + self.client.login(email='none@none.com', password='1234') + self.user = User.objects.get(email='none@none.com') + self.flashcard = Flashcard(text="jason", section=Section.objects.get(pk=1), material_date=now(), + author=self.user) + self.flashcard.save() + self.section = Section.objects.get(pk=1) + + def test_hide_flashcard(self): + url = '/api/flashcards/1/hide/' + data = {1, ''} + response = self.client.post(url, data, format='json') + self.assertEqual(response.status_code, HTTP_204_NO_CONTENT) -- 1.9.1