Unittests for view functions