Ejemplo n.º 1
0
    def setUp(self):
        VotaboTest.setUp(self)
        DBSession.add(self.user0)

        p1 = Post()
        p1.fingerprint = "5" * 32
        p1.tags.append(Tag.get_or_create(u"test-tag"))

        p1.comments.append(Comment(self.user0, "0.0.0.0", u"Comment X"))
        p1.comments.append(Comment(self.user1, "0.0.0.0", u"Comment Y"))
        p1.comments.append(Comment(self.user0, "0.0.0.0", u"Comment Z"))

        p2 = Post()
        p2.fingerprint = "6" * 32
        p2.tags.append(Tag.get_or_create(u"test-tag"))

        p3 = Post()
        p3.fingerprint = "7" * 32
        p3.tags.append(Tag.get_or_create(u"test-tag"))

        p3.comments.append(Comment(self.user0, "0.0.0.0", u"First comment"))
        p3.comments.append(Comment(self.user1, "0.0.0.0", u"Another comment"))
        p3.comments.append(Comment(self.user2, "0.0.0.0", u"Third comment"))

        self.user0.posts.append(p1)
        self.user0.posts.append(p2)
        self.user0.posts.append(p3)
Ejemplo n.º 2
0
Archivo: pm.py Proyecto: Azula/votabo
    def setUp(self):
        VotaboTest.setUp(self)
        self.pm1 = PrivateMessage(user_from=self.user0, user_to=self.user1, subject=u"Hello", message=u"hi there~", is_read=True)
        self.pm2 = PrivateMessage(user_from=self.user1, user_to=self.user0, subject=u"Re: Hello", message=u"ho ho ho", is_read=True)
        self.pm3 = PrivateMessage(user_from=self.user0, user_to=self.user1, subject=u"Re: Hello", message=u"har har")

        DBSession.add_all([self.pm1, self.pm2, self.pm3])
Ejemplo n.º 3
0
    def setUp(self):
        VotaboTest.setUp(self)
        DBSession.add(self.user0)

        p1 = Post()
        p1.fingerprint = "5" * 32
        p1.tags.append(Tag.get_or_create(u"test-tag"))

        p1.comments.append(Comment(self.user0, "0.0.0.0", u"Comment X"))
        p1.comments.append(Comment(self.user1, "0.0.0.0", u"Comment Y"))
        p1.comments.append(Comment(self.user0, "0.0.0.0", u"Comment Z"))

        p2 = Post()
        p2.fingerprint = "6" * 32
        p2.tags.append(Tag.get_or_create(u"test-tag"))

        p3 = Post()
        p3.fingerprint = "7" * 32
        p3.tags.append(Tag.get_or_create(u"test-tag"))

        p3.comments.append(Comment(self.user0, "0.0.0.0", u"First comment"))
        p3.comments.append(Comment(self.user1, "0.0.0.0", u"Another comment"))
        p3.comments.append(Comment(self.user2, "0.0.0.0", u"Third comment"))

        self.user0.posts.append(p1)
        self.user0.posts.append(p2)
        self.user0.posts.append(p3)
Ejemplo n.º 4
0
Archivo: tag.py Proyecto: Azula/votabo
 def setUp(self):
     VotaboTest.setUp(self)
     DBSession.add(Tag.get_or_create(u"apple"))
     DBSession.add(Tag.get_or_create(u"bacon"))
     DBSession.add(Tag.get_or_create(u"cat"))
     DBSession.add(Tag.get_or_create(u"kitten"))
     DBSession.add(Tag.get_or_create(u"pie"))
     DBSession.add(Tag.get_or_create(u"!!!"))
Ejemplo n.º 5
0
 def setUp(self):
     VotaboTest.setUp(self)
     self.pm1 = PrivateMessage(user_from=self.user0,
                               user_to=self.user1,
                               subject=u"Re: Hello",
                               message=u"har har")
     DBSession.add_all([self.pm1])
     DBSession.flush()
Ejemplo n.º 6
0
 def setUp(self):
     VotaboTest.setUp(self)
     wp1 = WikiPage()
     wp1.user = self.user0
     wp1.title = u"index"
     wp1.revision = 2
     wp1.body = u"This is the default wiki index page, v2"
     DBSession.add(wp1)
Ejemplo n.º 7
0
Archivo: tag.py Proyecto: Azula/votabo
 def setUp(self):
     VotaboTest.setUp(self)
     DBSession.add(Tag.get_or_create(u"apple"))
     DBSession.add(Tag.get_or_create(u"bacon"))
     DBSession.add(Tag.get_or_create(u"cat"))
     DBSession.add(Tag.get_or_create(u"kitten"))
     DBSession.add(Tag.get_or_create(u"pie"))
     DBSession.add(Tag.get_or_create(u"!!!"))
Ejemplo n.º 8
0
Archivo: wiki.py Proyecto: Azula/votabo
 def setUp(self):
     VotaboTest.setUp(self)
     wp1 = WikiPage()
     wp1.user = self.user0
     wp1.title = u"index"
     wp1.revision = 2
     wp1.body = u"This is the default wiki index page, v2"
     DBSession.add(wp1)
Ejemplo n.º 9
0
    def setUp(self):
        VotaboTest.setUp(self)
        self.pm1 = PrivateMessage(user_from=self.user0,
                                  user_to=self.user1,
                                  subject=u"Hello",
                                  message=u"hi there~",
                                  is_read=True)
        self.pm2 = PrivateMessage(user_from=self.user1,
                                  user_to=self.user0,
                                  subject=u"Re: Hello",
                                  message=u"ho ho ho",
                                  is_read=True)
        self.pm3 = PrivateMessage(user_from=self.user0,
                                  user_to=self.user1,
                                  subject=u"Re: Hello",
                                  message=u"har har")

        DBSession.add_all([self.pm1, self.pm2, self.pm3])
Ejemplo n.º 10
0
 def setUp(self):
     VotaboTest.setUp(self)
     DBSession.add(
         LogEvent(section=u"sect1",
                  username=u"test-admin",
                  address=u"1.2.3.4",
                  priority=0,
                  message=u"test message 1"))
     DBSession.add(
         LogEvent(section=u"sect1",
                  username=u"test-client",
                  address=u"0.0.0.0",
                  priority=0,
                  message=u"test message 2"))
     DBSession.add(
         LogEvent(section=u"sect1",
                  username=u"test-client",
                  address=u"0.0.0.0",
                  priority=0,
                  message=u"test message 3"))
Ejemplo n.º 11
0
 def setUp(self):
     VotaboTest.setUp(self)
     user = User.by_name(u"test-admin")
     untag_create(
         testing.DummyRequest(POST={
             "tag": u"untag_test1",
             "redirect": u"/wiki/TestX"
         },
                              user=user))
     untag_create(
         testing.DummyRequest(POST={
             "tag": u"untag_test2",
             "redirect": u"/wiki/TestY"
         },
                              user=user))
     untag_create(
         testing.DummyRequest(POST={
             "tag": u"untag_test3",
             "redirect": u"/wiki/TestY"
         },
                              user=user))
Ejemplo n.º 12
0
 def setUp(self):
     VotaboTest.setUp(self)
     user = User.by_name(u"test-admin")
     ipban_create(
         testing.DummyRequest(POST={
             "ip": u"1.2.3.4",
             "reason": u"TestX BanX",
             "until": u"+3 weeks"
         },
                              user=user))
     ipban_create(
         testing.DummyRequest(POST={
             "ip": u"1.2.3.5",
             "reason": u"TestY BanX",
             "until": u"+3 weeks"
         },
                              user=user))
     ipban_create(
         testing.DummyRequest(POST={
             "ip": u"6.2.3.4",
             "reason": u"TestY BanY",
             "until": u"+3 weeks"
         },
                              user=user))
Ejemplo n.º 13
0
 def setUp(self):
     VotaboTest.setUp(self)
     user = User.by_name(u"test-admin")
     ipban_create(testing.DummyRequest(POST={"ip": u"1.2.3.4", "reason": u"TestX BanX", "until": u"+3 weeks"}, user=user))
     ipban_create(testing.DummyRequest(POST={"ip": u"1.2.3.5", "reason": u"TestY BanX", "until": u"+3 weeks"}, user=user))
     ipban_create(testing.DummyRequest(POST={"ip": u"6.2.3.4", "reason": u"TestY BanY", "until": u"+3 weeks"}, user=user))
Ejemplo n.º 14
0
 def setUp(self):
     VotaboTest.setUp(self)
     DBSession.add(self.user0)
     self.post = self.user0.posts[0]
Ejemplo n.º 15
0
 def setUp(self):
     VotaboTest.setUp(self)
     user = User.by_name(u"test-admin")
     untag_create(testing.DummyRequest(POST={"tag": u"untag_test1", "redirect": u"/wiki/TestX"}, user=user))
     untag_create(testing.DummyRequest(POST={"tag": u"untag_test2", "redirect": u"/wiki/TestY"}, user=user))
     untag_create(testing.DummyRequest(POST={"tag": u"untag_test3", "redirect": u"/wiki/TestY"}, user=user))
Ejemplo n.º 16
0
Archivo: log.py Proyecto: Azula/votabo
 def setUp(self):
     VotaboTest.setUp(self)
     DBSession.add(LogEvent(section=u"sect1", username=u"test-admin", address=u"1.2.3.4", priority=0, message=u"test message 1"))
     DBSession.add(LogEvent(section=u"sect1", username=u"test-client", address=u"0.0.0.0", priority=0, message=u"test message 2"))
     DBSession.add(LogEvent(section=u"sect1", username=u"test-client", address=u"0.0.0.0", priority=0, message=u"test message 3"))
Ejemplo n.º 17
0
 def setUp(self):
     VotaboTest.setUp(self)
     DBSession.add(self.user0)
     self.post = self.user0.posts[0]
Ejemplo n.º 18
0
Archivo: pm.py Proyecto: Azula/votabo
 def setUp(self):
     VotaboTest.setUp(self)
     self.pm1 = PrivateMessage(user_from=self.user0, user_to=self.user1, subject=u"Re: Hello", message=u"har har")
     DBSession.add_all([self.pm1])
     DBSession.flush()