Hypothesis testing in sparse weighted stochastic block model