from {{package}}.tests import *
from {{package}}.tests import model, Session

class TestUser(TestModel):

    def setUp(self):
        TestModel.setUp(self)

    def test_authenticate(self):
        assert model.user.User.authenticate(u'tester', 'test')
        self.user.password = 'test_again'
        # self.user.flush()
        assert model.User.authenticate(u'tester', 'test_again')
    

    def test_permissions(self):
        assert not self.user.has_permission(u'add_users')
        self.ngroup.users.append(self.user)        
        assert self.user.has_permission(u'add_users')
    
