I have following code in decl_module
#[weight = 10_000 + T::DbWeight::get().reads_writes(1,1)]
pub fn create_deparment(origin, name: Vec<u8>, location: Vec<u8>, detail: Vec<u8>) -> dispatch::DispatchResult {
let _who = ensure_signed(origin)?;
let oldcount = DeparmentCount::get();
debug::info!("Old Deparment Count: {:?}", oldcount);
// print("Old Deparment Count");
Ok(())
}
This is my test:
#[test]
fn create_deparment_test() {
new_test_ext().execute_with(|| {
let _result = TemplateModule::create_deparment(Origin::signed(1), "Education".as_bytes().to_vec(), "India".as_bytes().to_vec(), "hashcode".as_bytes().to_vec());
});
}
I want to print the debug::info in terminal while running cargo test.
cargo test -- --nocapture
Is it possible?
Edit:
println! is working if you test only using template crate, so one can remove the println! while building the substrate runtime.