tests.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. from django.test import TestCase
  2. # Create your tests here.
  3. class SteamViewTestCase(TestCase):
  4. def testSteam(self):
  5. resp = self.client.get('/hackathon/steam/')
  6. self.assertEqual(resp.status_code, 200)
  7. def testSteamDiscountedGames(self):
  8. resp = self.client.get('/hackathon/steamDiscountedGames/')
  9. self.assertEqual(resp.status_code, 200)
  10. def testSteamPlaytimeForever(self):
  11. resp = self.client.get('/hackathon/steam/')
  12. for dict in resp.context:
  13. if 'playtime_forever' in dict:
  14. self.assertTrue('playtime_forever' in dict)
  15. def testSteamName(self):
  16. resp = self.client.get('/hackathon/steam/')
  17. for dict in resp.context:
  18. if 'name' in dict:
  19. self.assertTrue('name' in dict)
  20. def testSteamImg(self):
  21. resp = self.client.get('/hackathon/steam/')
  22. for dict in resp.context:
  23. if 'img_logo_url' in dict:
  24. self.assertTrue('img_logo_url' in dict)
  25. def testSteamAppID(self):
  26. resp = self.client.get('/hackathon/steam/')
  27. for dict in resp.context:
  28. if 'appid' in dict:
  29. self.assertTrue('appid' in dict)
  30. class HackathonViewsTestCase(TestCase):
  31. def testIndex(self):
  32. resp = self.client.get('/hackathon/api/')
  33. self.assertEqual(resp.status_code, 200)
  34. def testQuandlDowJones(self):
  35. resp = self.client.get('/hackathon/quandlDowJones/')
  36. self.assertEqual(resp.status_code, 200)
  37. def testQuandlSnp500(self):
  38. resp = self.client.get('/hackathon/quandlSnp500/')
  39. self.assertEqual(resp.status_code, 200)
  40. def testQuandlNasdaq(self):
  41. resp = self.client.get('/hackathon/quandlNasdaq/')
  42. self.assertEqual(resp.status_code, 200)
  43. def testGithubUser(self):
  44. resp = self.client.get('/hackathon/githubUser/')
  45. self.assertEqual(resp.status_code, 200)
  46. def testGithubTopRepositories(self):
  47. resp = self.client.get('/hackathon/githubTopRepositories/')
  48. self.assertEqual(resp.status_code, 200)
  49. def testGithubResume(self):
  50. resp = self.client.get('/hackathon/githubResume/')
  51. self.assertEqual(resp.status_code, 200)
  52. def testTwilio(self):
  53. resp = self.client.get('/hackathon/twilio/')
  54. self.assertEqual(resp.status_code, 200)