I'll try to elaborate on what eSelix said.
When you run your script, it creates a separate, distinct subshell:
Original CLI shell -> Script subshell
When your script executes
su -m testuser -c "export CLASS=TherightOne"
you are telling the computer that you want to spawn another shell and execute the command(s) following the -c
Original CLI shell -> Script subshell -> "dash c" sub-subshell
The export command takes place, and the environment in the "dash c" sub-subshell
is modified. The "dash c" sub-subshell closes immediately after the export completes.
As eSelix said, but phrased a little differently, a child/subshell inherits the environment from its parent shell. But a child/subshell cannot
push back environment changes to a parent.
For that reason, the export command in the "dash c" sub-subshell lives and dies in that shell alone.