Using assertRaises instead to check if an exception is raised when its supposed to