try
sed 's/[^#]contents^[^#]*contents of line.*/updated contents/' test-file
or with the start of line anchor ^, and you know that line start with content ... , you could do:
sed 's/^contents of line.*/updated contents/' test-file
If you know which line you are going to update, you can change directly with its address line number like.
sed '2s/content of line.*/updated content/' test-file
add -i when you were happy with the result.