Skip to content

Commit

Permalink
Add test case for view
Browse files Browse the repository at this point in the history
Add a test case where the attribute is not defined on either view or model
  • Loading branch information
Javex committed Apr 3, 2014
1 parent 7b3ac63 commit e15ec14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_views.py
Expand Up @@ -146,6 +146,11 @@ def test_iter_head_cols_missing_info_attr(self):
assert cols == [{'label': 'Test Text',
'css_class': 'column-test_text'}]

def test_iter_head_cols_wrong_attr(self):
self.View.list_display = ('doesnotexist',)
with pytest.raises(AttributeError):
list(self.view.iter_head_cols())

def test_iter_list_cols_default(self, obj):
cols = list(self.view.iter_list_cols(obj))
assert cols == ['ModelStr']
Expand Down

0 comments on commit e15ec14

Please sign in to comment.