Esempio n. 1
0
 def test_column_positions(self):
     self.form.fields = [
         FormField(label=u"Col 1"),
         FormField(label=u"Col 2")
     ]
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual([0, 1, 2, 3], [col.position for col in cols])
Esempio n. 2
0
 def test_column_public_respected(self):
     self.form.fields = [
         FormField(label=u"Public"),
         FormField(label=u"Private", public=False)
     ]
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual(3, len(cols))
     self.assertEqual(u"Public", cols[2].label)
Esempio n. 3
0
 def test_column_attributes(self):
     self.form.fields = [FormField(label=u"Label", key='key')]
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual(u"Label", cols[2].label)
     self.assertEqual('key', cols[2].key)
Esempio n. 4
0
 def test_default_columns(self):
     cols = Sheet.get_default_columns()
     self.assertEqual(2, len(cols))
     self.assertEqual(u"John Smith", cols[0].render(self.member))
     self.assertEqual(u"2000-12-24", cols[1].render(self.member))
Esempio n. 5
0
 def test_default_columns_included(self):
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual(2, len(cols))
     self.assertEqual(u"John Smith", cols[0].render(self.member))
     self.assertEqual(u"2000-12-24", cols[1].render(self.member))
Esempio n. 6
0
 def test_column_public_respected(self):
     self.form.fields = [ FormField(label=u"Public"), FormField(label=u"Private", public=False) ]
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual(3, len(cols))
     self.assertEqual(u"Public", cols[2].label)
Esempio n. 7
0
 def test_column_attributes(self):
     self.form.fields = [ FormField(label=u"Label", key='key') ]
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual(u"Label", cols[2].label)
     self.assertEqual('key', cols[2].key)
Esempio n. 8
0
 def test_column_positions(self):
     self.form.fields = [ FormField(label=u"Col 1"), FormField(label=u"Col 2") ]
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual([0, 1, 2, 3], [col.position for col in cols])
Esempio n. 9
0
 def test_default_columns_included(self):
     cols = Sheet.columns_from_form(self.form)
     self.assertEqual(2, len(cols))
     self.assertEqual(u"John Smith", cols[0].render(self.member))
     self.assertEqual(u"2000-12-24", cols[1].render(self.member))
Esempio n. 10
0
 def test_default_columns(self):
     cols = Sheet.get_default_columns()
     self.assertEqual(2, len(cols))
     self.assertEqual(u"John Smith", cols[0].render(self.member))
     self.assertEqual(u"2000-12-24", cols[1].render(self.member))