def testUnicodeTraceback(self): c = Client() assert not Error.objects.count() ldata = data.copy() ldata["traceback"] = "ɷo̚حٍ" c.post(reverse("error-post"), ldata) assert Error.objects.count() == 1
def testProfile(self): user = create_user() c = Client() data = test_data.copy() data["priority"] = 6 c.post(reverse("error-post"), data) assert Notification.all().count() == 0, Notification.all().count() data["priority"] = 5 c.post(reverse("error-post"), data) assert Notification.all().count() == 1 profile = get_profile(user) profile.notification = 8 data["priority"] = 5 c.post(reverse("error-post"), data) assert Notification.all().count() == 2 data["priority"] = 8 c.post(reverse("error-post"), data) assert Notification.all().count() == 2 data["priority"] = 9 c.post(reverse("error-post"), data) assert Notification.all().count() == 2
def testUnicodeTraceback(self): c = Client() assert not Error.all().count() ldata = data.copy() ldata["traceback"] = "ɷo̚حٍ" c.post(reverse("error-post"), ldata) assert Error.all().count() == 1
def testStringPriority(self): c = Client() assert not Error.all().count() ldata = data.copy() ldata["priority"] = "test" c.post(reverse("error-post"), ldata) assert Error.all().count() == 1
def testNoPriority(self): c = Client() assert not Error.objects.count() ldata = data.copy() del ldata["priority"] c.post(reverse("error-post"), ldata) assert Error.objects.count() == 1
def testNoPriority(self): c = Client() assert not Error.all().count() ldata = data.copy() del ldata["priority"] c.post(reverse("error-post"), ldata) assert Error.all().count() == 1
def testCountUpdate(self): ldata = data.copy() self.client.post(reverse("error-post"), ldata) assert Group.objects.all()[0].count == 1 ldata["count"] = 5 self.client.post(reverse("error-post"), ldata) assert Group.objects.all()[0].count == 6
def testNoNotification(self): c = Client() assert not Error.all().count() data = test_data.copy() data["priority"] = 6 c.post(reverse("error-post"), data) assert data["priority"] > 5, data["priority"] assert Error.all().count() == 1 assert Notification.all().count() == 0
def testBrowser(self): assert not Error.objects.count() ldata = data.copy() ldata["user_agent"] = "Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.5) Gecko/20060731 Ubuntu/dapper-security Firefox/1.5.0.5" self.client.post(reverse("error-post"), ldata) assert Error.objects.count() == 1 assert Error.objects.all()[0].user_agent_short == "Firefox" assert Error.objects.all()[0].user_agent_parsed == True assert Error.objects.all()[0].operating_system == "Linux"
def testNoNotification(self): c = Client() assert not Error.objects.all().count() data = test_data.copy() data["priority"] = 6 c.post(reverse("error-post"), data) assert data["priority"] > 5, data["priority"] assert Error.objects.all().count() == 1 assert Notification.objects.all().count() == 0
def testBrowser(self): c = Client() assert not Error.all().count() ldata = data.copy() ldata["user_agent"] = "Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11; de) KHTML/3.5.2 (like Gecko) Kubuntu 6.06 Dapper" c.post(reverse("error-post"), ldata) assert Error.all().count() == 1 assert Error.all()[0].user_agent_short == "Konqueror" assert Error.all()[0].user_agent_parsed == True assert Error.all()[0].operating_system == "Linux"
def testBrowser(self): c = Client() assert not Error.objects.count() ldata = data.copy() ldata["user_agent"] = "Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11; de) KHTML/3.5.2 (like Gecko) Kubuntu 6.06 Dapper" c.post(reverse("error-post"), ldata) assert Error.objects.count() == 1 assert Error.objects.all()[0].user_agent_short == "Konqueror" assert Error.objects.all()[0].user_agent_parsed == True assert Error.objects.all()[0].operating_system == "Linux"
def testGroup(self): self.client.post(reverse("error-post"), data) assert Group.objects.count() == 1, "Got %s groups, not 1" % Group.objects.count() self.client.post(reverse("error-post"), data) assert Group.objects.count() == 1 new_data = data.copy() new_data["status"] = 402 self.client.post(reverse("error-post"), new_data) assert Group.objects.count() == 2 # and test similar assert not Error.objects.order_by('pk')[2].get_similar() assert len(Error.objects.order_by('pk')[1].get_similar()) == 1 assert len(Error.objects.order_by('pk')[0].get_similar()) == 1
def testGroup(self): c = Client() c.post(reverse("error-post"), data) assert Group.objects.count() == 1, "Got %s groups, not 1" % Group.objects.count() c.post(reverse("error-post"), data) assert Group.objects.count() == 1 new_data = data.copy() new_data["status"] = 402 c.post(reverse("error-post"), new_data) assert Group.objects.count() == 2 # and test similar assert not Error.objects.all()[2].get_similar() assert len(Error.objects.all()[1].get_similar()) == 1 assert len(Error.objects.all()[1].get_similar()) == 1
def testGroup(self): c = Client() c.post(reverse("error-post"), data) assert Group.all().count() == 1, "Got %s groups, not 1" % Group.all().count() c.post(reverse("error-post"), data) assert Group.all().count() == 1 new_data = data.copy() new_data["status"] = 402 c.post(reverse("error-post"), new_data) assert Group.all().count() == 2 # and test similar assert not Error.all()[2].get_similar() assert len(Error.all()[1].get_similar()) == 1 assert len(Error.all()[1].get_similar()) == 1
def testUnicodeTraceback(self): assert not Error.objects.count() ldata = data.copy() ldata["traceback"] = "ɷo̚حٍ" self.client.post(reverse("error-post"), ldata) assert Error.objects.count() == 1
def testStringPriority(self): assert not Error.objects.count() ldata = data.copy() ldata["priority"] = "test" self.client.post(reverse("error-post"), ldata) assert Error.objects.count() == 1
def testNoPriority(self): assert not Error.objects.count() ldata = data.copy() del ldata["priority"] self.client.post(reverse("error-post"), ldata) assert Error.objects.count() == 1