Example #1
0
 def test_incorrect_backend_path(self):
     settings = {BACKEND_SETTING_NAME: 'foo.bar.invalid.InvalidClass'}
     with self.settings(**settings):
         with self.assertRaises(ImproperlyConfigured):
             get_backend()
Example #2
0
 def test_correct_backend_returned(self):
     with self.settings(**DUMMY_BACKEND_SETTINGS):
         backend = get_backend()
         self.assertTrue(isinstance(backend, DummyBackend))
Example #3
0
 def test_missing_setting(self):
     with self.assertRaises(ImproperlyConfigured):
         get_backend()
Example #4
0
 def test_invalid_backend_path(self):
     settings = {BACKEND_SETTING_NAME: 'invalid'}
     with self.settings(**settings):
         with self.assertRaises(ImproperlyConfigured):
             get_backend()
Example #5
0
 def setUp(self):
     dummy_backend = get_backend()
     dummy_backend.flush()
Example #6
0
 def setUp(self):
     dummy_backend = get_backend()
     dummy_backend.flush()
Example #7
0
 def test_correct_backend_returned(self):
     with self.settings(**DUMMY_BACKEND_SETTINGS):
         backend = get_backend()
         self.assertTrue(isinstance(backend, DummyBackend))
Example #8
0
 def test_incorrect_backend_path(self):
     settings = {BACKEND_SETTING_NAME: 'foo.bar.invalid.InvalidClass'}
     with self.settings(**settings):
         with self.assertRaises(ImproperlyConfigured):
             get_backend()
Example #9
0
 def test_invalid_backend_path(self):
     settings = {BACKEND_SETTING_NAME: 'invalid'}
     with self.settings(**settings):
         with self.assertRaises(ImproperlyConfigured):
             get_backend()
Example #10
0
 def test_missing_setting(self):
     with self.assertRaises(ImproperlyConfigured):
         get_backend()
Example #11
0
	def get_context_data(self, **kwargs):
		backend = user_streams.get_backend()
		stream = backend.filter_stream()
		return {
			'object_list': stream.select_related('content_object, user, user__profile').all().order_by('-created_at')
		}