Commit 4ca13177 authored by Ola Hermann Opheim's avatar Ola Hermann Opheim
Browse files

fix test and remove TODOs

parent a856dfce
......@@ -206,8 +206,6 @@
else {
// since style's width is in em, it'd be tough to calculate
// px value of it. let's use an estimated px for now
// TODO: IE returns wrong value for findPosX when in rtl mode
// (it returns as it was left aligned), needs to be fixed.
clock_box.style.left = findPosX(clock_link) - 110 + 'px';
}
clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px';
......@@ -379,8 +377,6 @@
else {
// since style's width is in em, it'd be tough to calculate
// px value of it. let's use an estimated px for now
// TODO: IE returns wrong value for findPosX when in rtl mode
// (it returns as it was left aligned), needs to be fixed.
cal_box.style.left = findPosX(cal_link) - 180 + 'px';
}
cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px';
......
......@@ -773,7 +773,6 @@ function Sizzle( selector, context, results, seed ) {
if ( (elem = context.getElementById( m )) ) {
// Support: IE, Opera, Webkit
// TODO: identify versions
// getElementById can match elements by name instead of ID
if ( elem.id === m ) {
results.push( elem );
......@@ -787,7 +786,6 @@ function Sizzle( selector, context, results, seed ) {
} else {
// Support: IE, Opera, Webkit
// TODO: identify versions
// getElementById can match elements by name instead of ID
if ( newContext && (elem = newContext.getElementById( m )) &&
contains( context, elem ) &&
......@@ -3860,7 +3858,7 @@ var dataUser = new Data();
// 2. Improve the module's maintainability by reducing the storage
// paths to a single mechanism.
// 3. Use the same single mechanism to support "private" and "user" data.
// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
// 4. _Never_ expose "private" data to user code
// 5. Avoid exposing implementation details on user objects (eg. expando properties)
// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
......@@ -3910,7 +3908,6 @@ jQuery.extend( {
dataUser.remove( elem, name );
},
// TODO: Now that all calls to _data and _removeData have been replaced
// with direct calls to dataPriv methods, these can be deprecated.
_data: function( elem, name, data ) {
return dataPriv.access( elem, name, data );
......
......@@ -11,7 +11,6 @@ chars_50 = "NNEcOLJyGWwOaXueq2sfYo2BPWOyGWwOaXChNueq2sfYo2BPWO"
chars_150 = "kNFRLRGi2KoOtEcOLJyGWwOaXChNueq2bq12qrlS6S0YPkku3JsfYo2BPWOhkNFRLRGi2KoOtEcOLJyGWwOaXChNueq2bq12qrlS6S0YPkku3JsfYo2BPWOhkNFRLRGi2KoOtEcOLJyGWwOaXChNue"
email_254 = "kNFkjhRLRGi2KoOtEcOLJyGWwOaXChNueq2bq12qrlS6S0YPkku3JsfYo2BPWOhkNFRLRGi2KoOtEcOLJyGWwOaXChNueq2bq12kNFRLRGi2KoOtEcOLJyGWwOaXChNueq2bq12qrlS6S0YPkku3JsfYo2BPWOhkNFRLRGi2KoOtEcOLJyGWwOaXChNueq2bq12qrlS6qrlS6S0YPkku3JsfYo2BPWOhkNFRLRGi2KoOtEcOLJyG@gmail.com"
class SignUpUsernameBoundaryTest(unittest.TestCase):
def setUp(self):
self.client = Client()
......@@ -153,19 +152,18 @@ class SignUpLastNameBoundaryTest(unittest.TestCase):
self.client.post('/user/signup/', self.test_data)
self.assertEquals(User.objects.count(), self.nr_of_users)
# FIXME
class SignUpCategoriesBoundaryTest(unittest.TestCase):
def setUp(self):
self.client = Client()
self.nr_of_users = User.objects.count()
ProjectCategory.objects.create(name='Category')
self.category_1 = ProjectCategory.objects.create(name='Category')
self.test_data = {
'username': 'username',
'first_name': 'firstname',
'last_name': 'lastname',
'categories': ProjectCategory.objects.get(name="Category").id,
'categories': self.category_1.id,
'company': 'company',
'email': 'user@example.com',
'email_confirmation': 'user@example.com',
......@@ -187,7 +185,6 @@ class SignUpCategoriesBoundaryTest(unittest.TestCase):
self.client.post('/user/signup/', self.test_data)
self.assertEquals(User.objects.count(), self.nr_of_users)
""" FIXME
def test_categories_boundary_multiple(self):
ProjectCategory.objects.create(name='Category2')
category_2_id = ProjectCategory.objects.get(name="Category2").id
......@@ -195,7 +192,7 @@ class SignUpCategoriesBoundaryTest(unittest.TestCase):
'username': 'username',
'first_name': 'firstname',
'last_name': 'lastname',
'categories': self.category_id,
'categories': self.category_1.id,
'categories': category_2_id,
'company': 'company',
'email': 'user@example.com',
......@@ -210,9 +207,7 @@ class SignUpCategoriesBoundaryTest(unittest.TestCase):
'street_address': 'Street 1'
}
self.client.post('/user/signup/', test_data)
self.assertEquals(User.objects.count(), self.nr_of_users)
"""
self.assertEquals(User.objects.count(), self.nr_of_users+1)
class SignUpCompanyBoundaryTest(unittest.TestCase):
def setUp(self):
......
from django.http import HttpResponse
from projects.models import ProjectCategory
from django.contrib import messages
from django.contrib.auth import login, authenticate
from django.contrib.auth.forms import UserCreationForm
from django.shortcuts import render, redirect, get_object_or_404
from .forms import SignUpForm
def index(request):
......@@ -23,7 +23,7 @@ def signup(request):
user.save()
raw_password = form.cleaned_data.get('password1')
user = authenticate(username=user.username, password=raw_password)
from django.contrib import messages
messages.success(request, 'Your account has been created and is awaiting verification.')
return redirect('home')
else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment