Add unittests for detail view