Test suite runs and passes!
[zzz-floof.git] / floof / websetup.py
index 815832d..8f3d896 100644 (file)
@@ -16,19 +16,22 @@ def setup_app(command, conf, vars):
     """Place any commands to setup floof here"""
     load_environment(conf.global_conf, conf.local_conf)
 
+    # We try to recreate the db when it already exists, like, a lot.  This
+    # fucks everything.  Do a dumb check for it.
+    assert not model.User.table.exists(), \
+           "Database is already initialized; please purge it first."
+
     ### Database schema
     model.metadata.create_all()
 
     ### Sample data
     # Users
-    from floof.model.users import IdentityURL, User
-    identity_url = IdentityURL(url=u'http://eevee.livejournal.com/')
-    user = User(name=u'Eevee')
+    identity_url = model.IdentityURL(url=u'http://eevee.livejournal.com/')
+    user = model.User(name=u'eevee', display_name=u'Eevee')
     user.identity_urls.append(identity_url)
 
     model.Session.commit()
 
-
     ### Filesystem stuff
     # Only necessary if we're using the filesystem for storage.
     # And we are!