Browse Source

Some cleanup

Harro van der Klauw 11 years ago
parent
commit
7831bb438c

+ 3 - 3
flaskbb/configs/testing.py

@@ -2,7 +2,7 @@
     flaskbb.configs.testing
     flaskbb.configs.testing
     ~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~
 
 
-    This is the FlaskBB's development config.
+    This is the FlaskBB's testing config.
 
 
     :copyright: (c) 2014 by the FlaskBB Team.
     :copyright: (c) 2014 by the FlaskBB Team.
     :license: BSD, see LICENSE for more details.
     :license: BSD, see LICENSE for more details.
@@ -12,7 +12,7 @@ from flaskbb.configs.default import DefaultConfig
 
 
 class TestingConfig(DefaultConfig):
 class TestingConfig(DefaultConfig):
 
 
-    # Indicates that it is a dev environment
+    # Indicates that it is a testing environment
     DEBUG = False
     DEBUG = False
     TESTING = True
     TESTING = True
 
 
@@ -24,7 +24,7 @@ class TestingConfig(DefaultConfig):
     )
     )
 
 
     # This will print all SQL statements
     # This will print all SQL statements
-    SQLALCHEMY_ECHO = True
+    SQLALCHEMY_ECHO = False
 
 
     # Security
     # Security
     SECRET_KEY = "SecretKeyForSessionSigning"
     SECRET_KEY = "SecretKeyForSessionSigning"

+ 3 - 0
flaskbb/utils/populate.py

@@ -119,6 +119,7 @@ def create_default_groups():
     """
     """
     This will create the 5 default groups
     This will create the 5 default groups
     """
     """
+    result = []
     for key, value in GROUPS.items():
     for key, value in GROUPS.items():
         group = Group(name=key)
         group = Group(name=key)
 
 
@@ -126,6 +127,8 @@ def create_default_groups():
             setattr(group, k, v)
             setattr(group, k, v)
 
 
         group.save()
         group.save()
+        result.append(group)
+    return result
 
 
 
 
 def create_admin_user(username, password, email):
 def create_admin_user(username, password, email):

+ 1 - 1
pytest.ini

@@ -1,3 +1,3 @@
 [pytest]
 [pytest]
 norecursedirs = docs flaskbb logs migrations whoosh_index
 norecursedirs = docs flaskbb logs migrations whoosh_index
-addopts = --strict --random -vvl
+addopts = --strict --random -vvl

+ 2 - 2
tests/fixtures/app.py

@@ -21,8 +21,8 @@ def application():
 
 
 @pytest.fixture()
 @pytest.fixture()
 def default_groups():
 def default_groups():
-    """By default we'll always want create the default groups."""
-    create_default_groups()
+    """Creates the default groups"""
+    return create_default_groups()
 
 
 
 
 @pytest.yield_fixture()
 @pytest.yield_fixture()

+ 1 - 1
tests/unit/utils/test_populate.py

@@ -7,7 +7,7 @@ from flaskbb.user.models import Group
 @pytest.fixture()
 @pytest.fixture()
 def default_groups():
 def default_groups():
     """Overwrite for the default fixture, in this case we don't want the default groups created."""
     """Overwrite for the default fixture, in this case we don't want the default groups created."""
-    pass
+    return []
 
 
 
 
 def test_create_default_groups(database):
 def test_create_default_groups(database):