Exemplo n.º 1
0
 def test_user_doesnt_belong_to_segment(self):
     definition = 'select * from %s where id != %s' % (user_table(),
                                                       self.u.id)
     s = SegmentFactory(definition=definition)
     self.assertFalse(s.has_member(self.u))
Exemplo n.º 2
0
 def test_user_belongs_to_segment(self):
     definition = 'select * from %s where id = %s' % (user_table(),
                                                      self.u.id)
     s = SegmentFactory(definition=definition)
     s.refresh()
     self.assertTrue(s.has_member(self.u))
Exemplo n.º 3
0
 def test_user_adds_to_segment(self):
     s = SegmentFactory()
     s.add_member(self.u)
     self.assertTrue(s.has_member(self.u))
Exemplo n.º 4
0
 def test_user_doesnt_belong_to_segment(self):
     definition = 'select * from %s where id != %s' % (user_table(), self.u.id)
     s = SegmentFactory(definition=definition)
     self.assertFalse(s.has_member(self.u))
Exemplo n.º 5
0
 def test_user_adds_to_segment(self):
     s = SegmentFactory()
     s.add_member(self.u)
     self.assertTrue(s.has_member(self.u))
Exemplo n.º 6
0
 def test_user_belongs_to_segment(self):
     definition = 'select * from %s where id = %s' % (user_table(), self.u.id)
     s = SegmentFactory(definition=definition)
     s.refresh()
     self.assertTrue(s.has_member(self.u))