Place get_view_data in models.py, add test.