Unittest for models functions