示例#1
0
 def setUp(self):
     self.old_models = get_models()
     SETTINGS['MODELS'] = {}
     for model in self.actstream_models:
         SETTINGS['MODELS'][model.lower()] = apps.get_model(
             *model.split('.'))
     setup_generic_relations()
 def setUp(self):
     self.old_MODELS = actstream_settings.MODELS
     actstream_settings.MODELS = {}
     for model in self.actstream_models:
         actstream_settings.MODELS[model.lower()] = \
             get_model(*model.split('.'))
     setup_generic_relations()
 def setUp(self):
     self.old_MODELS = actstream_settings.MODELS
     actstream_settings.MODELS = {}
     for model in self.actstream_models:
         actstream_settings.MODELS[model.lower()] = \
             get_model(*model.split('.'))
     setup_generic_relations()
示例#4
0
 def setUp(self):
     self.old_MODELS = actstream_settings.MODELS
     self.old_language = get_language()
     activate('en')
     actstream_settings.MODELS = {}
     for model in self.actstream_models:
         actstream_settings.MODELS[model.lower()] = \
             get_model(*model.split('.'))
     setup_generic_relations()
     super(ActivityBaseTestCase, self).setUp()
示例#5
0
    def setUp(self):
        super(ActivityTestCase, self).setUp()
        self.old_MODELS = actstream_settings.MODELS
        actstream_settings.MODELS = {}
        for model in self.actstream_models:
            actstream_settings.MODELS[model.lower()] = \
                get_model(*model.split('.'))
        setup_generic_relations()
        self.group = Group.objects.create(name='CoolGroup')
        self.group2 = Group.objects.create(name='Nerds')
        self.user1 = User.objects.get_or_create(username='******')[0]
        self.user1.set_password('admin')
        self.user1.is_superuser = self.user1.is_staff = True
        self.user1.save()
        self.user2 = User.objects.get_or_create(username='******')[0]

        # User1 joins group
        self.user1.groups.add(self.group)
        action.send(self.user1, verb='joined', target=self.group)

        # User1 follows User2
        follow(self.user1, self.user2)

        # User2 joins group
        self.user2.groups.add(self.group)
        action.send(self.user2, verb='joined', target=self.group)

        # User2 follows group
        follow(self.user2, self.group)

        # User2 follows the second group (also as a target).
        follow(self.user2, self.group2, target=True)

        # User1 comments on group
        # Use a site object here and predict the "__unicode__ method output"
        action.send(self.user1, verb='commented on', target=self.group)
        self.comment = Site.objects.create(
            domain="admin: Sweet Group!...")

        # Group responds to comment
        action.send(self.group, verb='responded to', target=self.comment)
示例#6
0
 def setUp(self):
     self.old_models = get_models()
     setup_generic_relations()
示例#7
0
 def ready(self):
     from actstream.models import setup_generic_relations
     setup_generic_relations()
 def setUp(self):
     self.old_models = get_models()
     SETTINGS['MODELS'] = {}
     for model in self.actstream_models:
         SETTINGS['MODELS'][model.lower()] = get_model(*model.split('.'))
     setup_generic_relations()