Beispiel #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))
Beispiel #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))
 def test_user_adds_to_segment(self):
     s = SegmentFactory()
     s.add_member(self.u)
     self.assertTrue(s.has_member(self.u))
Beispiel #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))
Beispiel #5
0
 def test_user_adds_to_segment(self):
     s = SegmentFactory()
     s.add_member(self.u)
     self.assertTrue(s.has_member(self.u))
Beispiel #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))