Exemplo n.º 1
0
    def setUp(self):

        setUpAccounts(self)
        setUpLocations(self)
        setUpResources(self)

        # reload these to avoid errors.
        self.resource6 = Resource.objects.get(id=self.resource6.id)
        self.resource7 = Resource.objects.get(id=self.resource7.id)

        self.curation1 = Curation(outcome='',
                                  tags=['#aliss-story'],
                                  note='This is my story, this is my song',
                                  owner=self.bob)
        self.curation1.item_metadata.update(author=self.bob)
        add_curation(self.resource6, self.curation1)

        self.curation2 = Curation(
            outcome='',
            tags=['#aliss-story'],
            note='Follow the hearts and, you can\'t go wrong',
            owner=self.bob)
        self.curation2.item_metadata.update(author=self.bob)
        add_curation(self.resource7, self.curation2)

        self.jorph.tags = ['#aliss-story']
        self.jorph.save()

        reindex_accounts(url=settings.TEST_SOLR_URL)
        reindex_resources(url=settings.TEST_SOLR_URL)

        from django.test.client import Client
        self.client = Client()
Exemplo n.º 2
0
    def setUp(self):

        from analytics.models import AccountAnalytics, OverallAnalytics
        from accounts.models import Account

        from accounts.tests import setUpAccounts
        from locations.tests import setUpLocations
        from resources.tests import setUpResources
        from enginecab.views import reindex_resources

        setUpAccounts(self)
        setUpLocations(self)
        setUpResources(self)        
        reindex_resources(url=settings.TEST_SOLR_URL)

        self.account = Account.objects[2]

        self.account_analytics = AccountAnalytics(self.account, redis_db=settings.TEST_REDIS_ANALYTICS_DATABASE)
        self.overall_analytics = OverallAnalytics(redis_db=settings.TEST_REDIS_ANALYTICS_DATABASE)
        self.redis = self.account_analytics.conn
        self.redis.flushdb()

        from django.test.client import Client

        self.client = Client()
Exemplo n.º 3
0
    def setUp(self):

        from analytics.models import AccountAnalytics, OverallAnalytics
        from accounts.models import Account

        from accounts.tests import setUpAccounts
        from locations.tests import setUpLocations
        from resources.tests import setUpResources
        from enginecab.views import reindex_resources

        setUpAccounts(self)
        setUpLocations(self)
        setUpResources(self)
        reindex_resources(url=settings.TEST_SOLR_URL)

        self.account = Account.objects[2]

        self.account_analytics = AccountAnalytics(
            self.account, redis_db=settings.TEST_REDIS_ANALYTICS_DATABASE)
        self.overall_analytics = OverallAnalytics(
            redis_db=settings.TEST_REDIS_ANALYTICS_DATABASE)
        self.redis = self.account_analytics.conn
        self.redis.flushdb()

        from django.test.client import Client

        self.client = Client()
Exemplo n.º 4
0
    def setUp(self):

        setUpAccounts(self)
        setUpLocations(self)
        setUpResources(self)

        # reload these to avoid errors.
        self.resource6 = Resource.objects.get(id=self.resource6.id)
        self.resource7 = Resource.objects.get(id=self.resource7.id)

        self.curation1 = Curation(
            outcome='',
            tags=['#aliss-story'],
            note='This is my story, this is my song',
            owner=self.bob)
        self.curation1.item_metadata.update(author=self.bob)
        add_curation(self.resource6, self.curation1)

        self.curation2 = Curation(
            outcome='',
            tags=['#aliss-story'],
            note='Follow the hearts and, you can\'t go wrong',
            owner=self.bob)
        self.curation2.item_metadata.update(author=self.bob)
        add_curation(self.resource7, self.curation2)

        self.jorph.tags = ['#aliss-story']
        self.jorph.save()

        reindex_accounts(url=settings.TEST_SOLR_URL)
        reindex_resources(url=settings.TEST_SOLR_URL)

        from django.test.client import Client
        self.client = Client()
Exemplo n.º 5
0
    def setUp(self):
        from accounts.tests import setUpAccounts
        from locations.tests import setUpLocations
        from enginecab.views import reindex_resources

        setUpAccounts(self)
        setUpLocations(self)
        setUpResources(self)        
        reindex_resources(url=settings.TEST_SOLR_URL)
Exemplo n.º 6
0
    def setUp(self):
        from accounts.tests import setUpAccounts
        from locations.tests import setUpLocations
        from enginecab.views import reindex_resources

        setUpAccounts(self)
        setUpLocations(self)
        setUpResources(self)
        reindex_resources(url=settings.TEST_SOLR_URL)
Exemplo n.º 7
0
    def test_home(self):
        from django.core.urlresolvers import reverse
        from enginecab.views import reindex_resources
        reindex_resources(url=settings.TEST_SOLR_URL)

        response = self.client.get(reverse('home'))
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, "Welcome to ALISS")

        response = self.client.get(reverse('youraliss'))
        self.assertEqual(response.status_code, 302)

        self.client.login(username='******', password='******')
        response = self.client.get(reverse('youraliss'))
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, "profile")

        response = self.client.get(reverse('search'))
        self.assertEqual(response.status_code, 200)

        response = self.client.post(reverse('resource_find'),
            data={'kwords': 'green'})
        self.assertEqual(response.status_code, 200)
        self.assertContains(response, 'title 1')