Пример #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])
Пример #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)
Пример #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)
Пример #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))
Пример #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))
Пример #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)
Пример #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)
Пример #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])
Пример #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))
Пример #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))