@pytest.mark.cmd
@pytest.mark.django_db
def test_find_duplicate_emails_withdups(capfd, member_with_email, member2_with_email):
 member2_with_email.email = member_with_email.email
 member2_with_email.save()
 call_command('find_duplicate_emails')
 (out, err) = capfd.readouterr()
 assert ('The following users have the email: member_with_email@this.test' in out)
 assert ('member_with_email' in out)
 assert ('member2_with_email' in out)

@ pytest . mark . cmd @ pytest . mark . django_db def test_find_duplicate_emails_withdups ( capfd , member_with_email , member2_with_email ) : member2_with_email . email = member_with_email . email member2_with_email . save ( ) call_command ( 'find_duplicate_emails' ) ( out , err ) = capfd . readouterr ( ) assert ( 'The following users have the email: member_with_email@this.test' in out ) assert ( 'member_with_email' in out ) assert ( 'member2_with_email' in out )
find duplicate emails for removal where we have dups .