コード例 #1
0
ファイル: tests.py プロジェクト: erikrose/arecibo
 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
コード例 #2
0
ファイル: tests.py プロジェクト: pajenterprise/arecibo
    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
コード例 #3
0
ファイル: tests.py プロジェクト: pajenterprise/arecibo
 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
コード例 #4
0
ファイル: tests.py プロジェクト: alanjds/arecibo
 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
コード例 #5
0
ファイル: tests.py プロジェクト: erikrose/arecibo
 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
コード例 #6
0
ファイル: tests.py プロジェクト: pajenterprise/arecibo
 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
コード例 #7
0
ファイル: tests.py プロジェクト: andymckay/arecibo
    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
コード例 #8
0
ファイル: tests.py プロジェクト: sowink/arecibo
    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
コード例 #9
0
    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
コード例 #10
0
ファイル: tests.py プロジェクト: andymckay/arecibo
 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
コード例 #11
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"
コード例 #12
0
ファイル: tests.py プロジェクト: pajenterprise/arecibo
 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
コード例 #13
0
ファイル: tests.py プロジェクト: sowink/arecibo
 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"
コード例 #14
0
ファイル: tests.py プロジェクト: pajenterprise/arecibo
 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"
コード例 #15
0
ファイル: tests.py プロジェクト: erikrose/arecibo
 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"
コード例 #16
0
ファイル: tests.py プロジェクト: sowink/arecibo
 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
コード例 #17
0
    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
コード例 #18
0
ファイル: tests.py プロジェクト: erikrose/arecibo
    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
コード例 #19
0
ファイル: tests.py プロジェクト: pajenterprise/arecibo
    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
コード例 #20
0
 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
コード例 #21
0
ファイル: tests.py プロジェクト: sowink/arecibo
 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
コード例 #22
0
 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