コード例 #1
0
    def test_merge_non_calc_attrs_should_copy_some_attrs(self):
        s1 = Sheet()
        s1.name = 's1'
        s1.column_widths = {'s1': 0}
        s1.contents_json = sentinel.sheet1
        s2 = Sheet()
        s2.name = 's2'
        s2.column_widths = {'s2': 0}
        s2.contents_json = sentinel.sheet2

        s1.merge_non_calc_attrs(s2)

        self.assertEquals(s1.name, 's2')
        self.assertEquals(s1.column_widths, {'s2': 0})
        self.assertEquals(s1.contents_json, sentinel.sheet1)
コード例 #2
0
 def test_sheet_name_not_set_on_save_if_name_is_not_default(self):
     user = User(username='******')
     user.save()
     sheet = Sheet(owner=user)
     sheet.name = 'new sheet name'
     sheet.save()
     self.assertEquals(sheet.name, 'new sheet name')