|
@@ -1,18 +1,46 @@
|
|
|
from django.test import TestCase
|
|
from django.test import TestCase
|
|
|
|
|
|
|
|
-# Create your tests here.
|
|
|
|
|
|
|
+class SteamViewTestCase(TestCase):
|
|
|
|
|
+ def testSteam(self):
|
|
|
|
|
+ resp = self.client.get('/hackathon/steam/')
|
|
|
|
|
+ self.assertEqual(resp.status_code, 200)
|
|
|
|
|
|
|
|
-class HackathonViewsTestCase(TestCase):
|
|
|
|
|
- def testIndex(self):
|
|
|
|
|
- resp = self.client.get('/hackathon/api/')
|
|
|
|
|
|
|
+ def testSteamDiscountedGames(self):
|
|
|
|
|
+ resp = self.client.get('/hackathon/steamDiscountedGames/')
|
|
|
self.assertEqual(resp.status_code, 200)
|
|
self.assertEqual(resp.status_code, 200)
|
|
|
|
|
|
|
|
- def testSteam(self):
|
|
|
|
|
- resp = self.client.get('/hackathon/steam')
|
|
|
|
|
- self.assertEqual(resp.status_code, 301)
|
|
|
|
|
|
|
+ def testSteamPlaytimeForever(self):
|
|
|
|
|
+ resp = self.client.get('/hackathon/steam/')
|
|
|
|
|
+ for dict in resp.context:
|
|
|
|
|
+ if 'playtime_forever' in dict:
|
|
|
|
|
+ self.assertTrue('playtime_forever' in dict)
|
|
|
|
|
|
|
|
- def testSteamDiscountedGames(self):
|
|
|
|
|
|
|
+ def testSteamName(self):
|
|
|
|
|
+ resp = self.client.get('/hackathon/steam/')
|
|
|
|
|
+ for dict in resp.context:
|
|
|
|
|
+ if 'name' in dict:
|
|
|
|
|
+ self.assertTrue('name' in dict)
|
|
|
|
|
+
|
|
|
|
|
+ def testSteamImg(self):
|
|
|
|
|
+ resp = self.client.get('/hackathon/steam/')
|
|
|
|
|
+ for dict in resp.context:
|
|
|
|
|
+ if 'img_logo_url' in dict:
|
|
|
|
|
+ self.assertTrue('img_logo_url' in dict)
|
|
|
|
|
+
|
|
|
|
|
+ def testSteamAppID(self):
|
|
|
|
|
+ resp = self.client.get('/hackathon/steam/')
|
|
|
|
|
+ for dict in resp.context:
|
|
|
|
|
+ if 'appid' in dict:
|
|
|
|
|
+ self.assertTrue('appid' in dict)
|
|
|
|
|
+
|
|
|
|
|
+ def testSteamDiscountedGamesDiscount(self):
|
|
|
resp = self.client.get('/hackathon/steamDiscountedGames/')
|
|
resp = self.client.get('/hackathon/steamDiscountedGames/')
|
|
|
|
|
+ self.assertEqual(resp.context, None)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+class HackathonViewsTestCase(TestCase):
|
|
|
|
|
+ def testIndex(self):
|
|
|
|
|
+ resp = self.client.get('/hackathon/api/')
|
|
|
self.assertEqual(resp.status_code, 200)
|
|
self.assertEqual(resp.status_code, 200)
|
|
|
|
|
|
|
|
def testQuandlDowJones(self):
|
|
def testQuandlDowJones(self):
|