title: Login with code when using LiveServerTestCase with Django
body: <p>So I have a Selenium functional test suite. I've already tested login/signup functionality in a few tests by navigating the Selenium client to the signup page, entering in a username and password, and then telling Selenium to login with those same credentials. Now I want to test other parts of the "login required" areas of the site without having to tell Selenium to click and enter text into the test browser.</p>
  
  <p>In other words, I would like to use something like this (which I use just fine in my view unit tests):</p>
  
  <pre><code>self.client = Client()  
  self.user = User.objects.create_user('temporary', 'temporary@gmail.com', 'temporary')  
  self.user.save()  
  self.client.login(username='temporary', password='temporary')
  </code></pre>
  
  <p>in my Selenium tests so I don't have to repeat the lengthy manual login process in every one of my tests (since I've already tested the login system in earlier tests as I said before)</p>
  
  <p>As of right now, I just copy and paste the 'login flow' Selenium instructions for each of my tests that require login. This causes my tests to take an addition 5-6 seconds each and it makes my function_tests.py file very bloated.</p>
  
  <p>All my Googling has brought me to pages teaching me how to test login with Selenium.</p>
  
  <p>Thanks in advance.</p>