Esempio n. 1
0
 def test_fields(self):
     s = Vrec(
         id = "asdf235",
         fields=["one", "two", "three"]
     )
     self.assertEquals(s.build(), 
         "products/vrec?id=asdf235" + 
         '&fields=' + enc("one,two,three")
     )
Esempio n. 2
0
 def test_multi_filters(self):
     s = Vrec(
         id="abcd1234",
         filter=[
             NF.cnf(
                 (Field('Color') == 'Red') & (Field('Color') != 'Blue')
             ),
             NF.dnf(
                 Field('Price').between(0, 100)
             )
         ]
     )
     self.assertEquals(s.build(), 
         "products/vrec?id=abcd1234" + 
         '&filter=' + enc(r"exp=Color:Red,Color:!Blue/type=cnf") +
         '&filter=' + enc(r"exp=Price:[0:100]/type=dnf")
     )
Esempio n. 3
0
 def test_simple_vrec(self):
     s = Vrec(id="a1234")
     self.assertEquals(s.build(), "products/vrec?id=a1234")
Esempio n. 4
0
 def test_simple_vrec_1(self):
     s = Vrec(id="a1234", num=10)
     self.assertEquals(s.build(), "products/vrec?id=a1234&num=10")