Created
November 9, 2011 13:38
-
-
Save gilsondev/1351450 to your computer and use it in GitHub Desktop.
Exemplo de como testar se determinado registro foi excluído no banco de dados no Django.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf8 -*- | |
from django.test import TestCase | |
# (...) | |
def test_excluir_usuario(self): | |
"""O Usuario e excluido?""" | |
id_usuario = 12 # Teste desse exemplo | |
self.assertRaises(User.DoesNotExist, User.objects.get, | |
pk=id_usuario) |
Está certo. Obrigado pela correção =)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Esse teste é para verificar se o usuário foi excluído e não inserido.