#NEWLINE# def test_username_bad_chars( self ) : #NEWLINE# #INDENT# self . data [ 'username' ] = 'bobb@example.com' #NEWLINE# serializer = api . ProfileSerializer ( data = self . data ) #NEWLINE# eq_ ( serializer . is_valid ( ) , False ) #NEWLINE# eq_ ( serializer . errors , { #NEWLINE# #INDENT# 'username' : [ 'Usernames may only be letters, numbers, "." and "-".' ] , #NEWLINE# #UNINDENT# } )