I'm taking the title of the question to allow general tests for divisibility by 7 even though the specifics of the original question is about a particular test. Apologies if this is not right - I'm still fairly new to mse.
[Source for this answer is The Lore of Large Numbers, by P. Davis, p. 87-88]
A number is divisible by 7 if and only if:
(3 * units' digit) + (2 * tens' digit) - (1 * hundreds' digit) - (3 * thousands' digit) - (2 * ten thousands' digit) + (1 * hundred thousands' digit) is divisible by 7.
If there are more digits present, the sequence of multipliers 3, 2, -1, -3, -2, 1 is repeated as often as necessary. If fewer digits are present, stop when get to the last multiplier.
Example:
$$7 * 457404 = 3201828$$
$$
\begin{array}
&3 & * & 8 & = & 24 \\
2 & * & 2 & = & 4 \\
-1 & * & 8 & = &-8 \\
-3 & * & 1 & = &-3 \\
-2 & * & 0 & = &0 \\
1 & * & 2 & = &2 \\
3 & * & 3 & = & 9 \\
\end{array}
$$
Since $24 + 4 - 8 - 3 + 0 + 2 + 9 = 28$ and 7 divides 28, $3201828$ is divisible by 7.
Proof for 3 digit numbers
$$N = 100a + 10b + c,$$ then if $S$ is the sum required by the test,
$$S = -a + 2b + 3c.$$
Then $2S = -2a + 4b + 6c$ and
$N + 2S = 98a + 14b + 7c = 7(14a + 2b + c)$.
The sum $N + 2S$ is therefore a multiple of $7$, say $7M$.
Now if $N$ is a multiple of $7$, say $7P$, then $2S = 7M - 7P = 7(M - P).$ Since therefore $2S$ is divisible by $7$ and $S$ is whole, $S$ also is divisible by $7$ (or $S = \frac{7X}{2},$ where $X$ is even because $S$ is whole).
Conversely, if $S$ is a multiple of $7$, say $7Q$, then
$$N = 7M - 14Q = 7(M - 2Q).$$
This means that $N$ must be a multiple of $7$.
Yet another way to do it is to use a similar alternating sum test as for divisibility by 11, but in 3 digit groups, subtracting first, with the sum's divisibility by 7 determining the original number's divisibility by 7.
In the $3201828$ example, this is $828 - 201 + 3 = 630,$ so since $630$ is divisible by $7$, so is $3201828$. I got this from Link.