Use proper assert* methods in test.

This remove PendingDeprecationWarnings.