from datetime import datetime, timedelta
import time
import hashlib

from routes import url_for
from pylons import config
from {{package}} import model
from {{package}}.tests import *
from {{package}}.tests import db

class TestLoginController(TestController):
    
    def setUp(self):
        TestModel.setUp(self)
    
    
    def tearDown(self):
        TestModel.tearDown(self)
        # Session.close()
    
    
    def test_add_group(self):
        gadmin = model.user.Group(
                name = "Editors",
                description = u"Editorial group",
                created = datetime.utcnow(),
                active = True)
        gadmin.store(db)
        
        gadmin_retrieved = model.Group.load(db, gadmin.id)
        
        assert gadmin_retrieved.name == gadmin.name
    

