Revision dd53338a logic/tests.py

b/logic/tests.py
10 10
from synnefo.logic import credits
11 11
from synnefo.logic import users
12 12
from django.test import TestCase
13
from django.core.exceptions import ObjectDoesNotExist
14 13

  
15 14
import hashlib
16 15

  
......
116 115
        """
117 116
        user = self._register_user()
118 117
        self.assertNotEquals(user, None)
119
        
118

  
120 119
        #Check hash generation
121 120
        md5 = hashlib.md5()
122 121
        md5.update(user.uniq)
......
129 128
        """
130 129
        user = self._register_user()
131 130
        users.delete_user(user)
132
        user1 = None
133 131

  
134
        try:
135
            user1 = SynnefoUser.objects.get(name = "jpage")
136
        except ObjectDoesNotExist:
137
            self.assertEquals(user1, None)
132
        self.assertRaises(SynnefoUser.DoesNotExist, SynnefoUser.objects.get, name = "jpage")

Also available in: Unified diff