Ejemplo n.º 1
0
 def test_generate_badge_returns_true_when_operation_is_complete(self):
     u = User.objects.create_user("test", "*****@*****.**", "pass")
     e = Event.objects.create(name="Test", user=u)
     request = HttpRequest()
     request.GET = {}
     response = are_badges_ready(request, e.id)
     self.assertEquals(200, response.status_code)
     self.assertEquals("application/json", response["Content-Type"])
     self.assertEquals(True, simplejson.loads(response.content)["status"]["ready"])
Ejemplo n.º 2
0
 def test_generate_badge_returns_false_when_blank_files_exist(self):
     u = User.objects.create_user("test", "*****@*****.**", "pass")
     e = Event.objects.create(name="Test", user=u)
     i = Item.objects.create(event=e, name="Blah", properties="{}")
     request = HttpRequest()
     request.GET = {}
     response = are_badges_ready(request, e.id)
     self.assertEquals(200, response.status_code)
     self.assertEquals("application/json", response["Content-Type"])
     self.assertEquals(False, simplejson.loads(response.content)["status"]["ready"])
Ejemplo n.º 3
0
 def test_generate_badge_returns_true_when_operation_is_complete(self):
     u = User.objects.create_user("test", "*****@*****.**", "pass")
     e = Event.objects.create(name="Test", user=u)
     request = HttpRequest()
     request.GET = {}
     response = are_badges_ready(request, e.id)
     self.assertEquals(200, response.status_code)
     self.assertEquals("application/json", response["Content-Type"])
     self.assertEquals(
         True,
         simplejson.loads(response.content)["status"]["ready"])
Ejemplo n.º 4
0
 def test_generate_badge_returns_false_when_blank_files_exist(self):
     u = User.objects.create_user("test", "*****@*****.**", "pass")
     e = Event.objects.create(name="Test", user=u)
     i = Item.objects.create(event=e, name="Blah", properties="{}")
     request = HttpRequest()
     request.GET = {}
     response = are_badges_ready(request, e.id)
     self.assertEquals(200, response.status_code)
     self.assertEquals("application/json", response["Content-Type"])
     self.assertEquals(
         False,
         simplejson.loads(response.content)["status"]["ready"])