A function f:[n_1] x ... x [n_d]-->F is a direct sum if it is of the form f(a_1,...,a_d) = f_1(a_1) + ... + f_d (a_d) (mod 2) for some d functions f_i:[n_i]-->F_i for all i=1,...,d. We present a 4-query test which distinguishes between direct sums and functions that are far from them. The test relies on the BLR linearity test (Blum, Luby, Rubinfeld, 1993) and on an agreement test which slightly generalizes the direct product test.In multiplicative {+1,-1} notation, our result reads as follows. A d-dimensional tensor with {+1,-1} entries is called a tensor product if it is a tensor product of d vectors with {+1,-1} entries, or equivalently, if it is of rank 1. The presented tests can be read as tests for distinguishing between tensor products and tensors that are far from being tensor products.We also present a different test, which queries the function at most (d+2) times, but is easier to analyze.