Back
Oct 11, 2010

Testing authentication in Django

Vladimir Sidorenko
Vladimir Sidorenko

In order to check if user is authentcated in test, you can run:

from django.contrib.auth import get_user

  class MyTestCase(TestCase):
      def test_login(self):
          self.assertFalse(get_user(self.client).is_authenticated())
          self.client.login(username='fred', password='secret')
          self.assertTrue(get_user(self.client).is_authenticated())

More thoughts

Dec 01, 2016Technology
How to Use Django & PostgreSQL for Full Text Search

For any project there may be a need to use a database full-text search. We expect high speed and relevant results from this search. When we face such problem, we usually think about Solr, ElasticSearch, Sphinx, AWS CloudSearch, etc. But in this article we will talk about PostgreSQL. Starting from version 8.3, a full-text search support in PostgreSQL is available. Let's look at how it is implemented in the DBMS itself.

Vladimir Kalyuzhny
Vladimir Kalyuzhny
Jul 27, 2017Technology
How to Deploy Django app with AWS Elastic Beanstalk?

In this article I'll show you how to deploy Django application to AWS Beanstalk.

Rostyslav Stekh
Rostyslav Stekh
Jun 03, 2019TechnologyBusiness
Top 10 Web Development Frameworks in 2019-2020

We have reviewed the top web frameworks for server and client-side development and compared their pros and cons. Find out which one can be a great fit for your next project.

Anastasia Kryzhanovska
Anastasia Kryzhanovska
Jan 28, 2017Technology
Creating a site preview like in slack (using aiohttp)

In this article we will write a small library for pulling metadata and creating a preview for a site just like Slack does.

Igor Tokarev
Igor Tokarev