Permalink
Browse files

more test prep

  • Loading branch information...
1 parent f56f166 commit d740678b4f12a14462ae960933dac1951fafba98 @pydanny pydanny committed Apr 12, 2012
@@ -0,0 +1,6 @@
+from mongonaut.tests import MongoTestCase
+
+
+class TestModels(MongoTestCase):
+
+ pass
No changes.
@@ -1 +0,0 @@
-from mongonaut.tests.test_views import *
View
@@ -1,37 +0,0 @@
-from mongoengine import BooleanField
-from mongoengine import DateTimeField
-from mongoengine import Document
-from mongoengine import EmbeddedDocument
-from mongoengine import EmbeddedDocumentField
-from mongoengine import ListField
-from mongoengine import ReferenceField
-from mongoengine import StringField
-
-
-class User(Document):
- email = StringField(required=True, max_length=50)
- first_name = StringField(max_length=50)
- last_name = StringField(max_length=50)
-
-
-class EmbeddedUser(EmbeddedDocument):
- email = StringField(required=True, max_length=50)
- first_name = StringField(max_length=50)
- last_name = StringField(max_length=50)
-
-
-class Comment(EmbeddedDocument):
- content = StringField()
- name = StringField(max_length=120)
-
-
-class Post(Document):
- # See Post.title.max_length to make validation better!
- title = StringField(max_length=120, required=True)
- author = ReferenceField(User)
- content = StringField()
- tags = ListField(StringField(max_length=30))
- comments = ListField(EmbeddedDocumentField(Comment))
- pub_date = DateTimeField()
- published = BooleanField()
- creator = EmbeddedDocumentField(EmbeddedUser) # for testing purposes
@@ -1,6 +0,0 @@
-from mongonaut.utils import MongoTestCase
-
-
-class TestViews(MongoTestCase):
-
- pass
View
@@ -1,28 +0,0 @@
-#coding: utf-8
-"""
- Copied exactly from https://github.com/hmarr/mongoengine/blob/master/mongoengine/django/tests.py
-
-"""
-
-from django.test import TestCase
-from django.conf import settings
-
-from mongoengine import connect
-
-
-class MongoTestCase(TestCase):
- """
- TestCase class that clear the collection between the tests
- """
- db_name = 'test_%s' % settings.MONGO_DATABASE_NAME
-
- def __init__(self, methodName='runtest'):
- self.db = connect(self.db_name)
- super(MongoTestCase, self).__init__(methodName)
-
- def _post_teardown(self):
- super(MongoTestCase, self)._post_teardown()
- for collection in self.db.collection_names():
- if collection == 'system.indexes':
- continue
- self.db.drop_collection(collection)

0 comments on commit d740678

Please sign in to comment.