def test_with_user(self):
     test_user = User.objects.create_user(
         'testuser', '*****@*****.**', token='bla')
     url = tags.ontherunurl({'request': self._create_request()},
                            user=test_user)
     self.assertTrue(url.endswith(reverse(
         'ontherun', kwargs={'username': '******', 'token': 'bla'})))
예제 #2
0
 def test_with_user(self):
     test_user = User.objects.create_user('testuser',
                                          '*****@*****.**',
                                          token='bla')
     url = tags.ontherunurl({'request': self._create_request()},
                            user=test_user)
     self.assertTrue(
         url.endswith(
             reverse('ontherun',
                     kwargs={
                         'username': '******',
                         'token': 'bla'
                     })))
 def test_profileuser_with_request(self):
     testuser = User.objects.create(username='******', token='bla')
     url = tags.ontherunurl({'request': self._create_request(),
                             'profileuser': testuser})
     self.assertTrue(url.endswith(reverse(
         'ontherun', kwargs={'username': '******', 'token': 'bla'})))
 def test_profileuser_without_request(self):
     testuser = User.objects.create(username='******')
     with self.assertRaises(KeyError):
         tags.ontherunurl({'profileuser': testuser})
 def test_no_user(self):
     with self.assertRaises(KeyError):
         tags.ontherunurl({})
 def test_profileuser_without_request(self):
     test_user = User.objects.create_user('testuser', '*****@*****.**')
     with self.assertRaises(KeyError):
         tags.ontherunurl({'profileuser': test_user})
예제 #7
0
 def test_profileuser_without_request(self):
     test_user = User.objects.create_user('testuser', '*****@*****.**')
     with self.assertRaises(KeyError):
         tags.ontherunurl({'profileuser': test_user})
예제 #8
0
 def test_no_user(self):
     with self.assertRaises(KeyError):
         tags.ontherunurl({})