Permalink
Browse files

Upgrade celery, Fix integration tests

Upgrade celery to latest.  The celery task application will need to be
reset.

Integration (lettuce) tests only run properly with Firefox 10.  A
setting has been added to specify the path to the firefox binary to use
for testing.
  • Loading branch information...
1 parent 5073236 commit c4fb1bba386a0bd526abb716cb2e8d3d7cacb244 @yourcelf committed May 29, 2012
@@ -7,13 +7,17 @@
from selenium import webdriver
from django.contrib.auth.models import User, Group
+from django.conf import settings
from profiles.models import Organization
+from btblettuce import hard_click
@before.all
def get_browser():
- world.browser = webdriver.Firefox()
-
- world.browser.implicitly_wait(1)
+ binary = webdriver.firefox.firefox_binary.FirefoxBinary(
+ firefox_path=settings.SELENIUM_FIREFOX_BIN
+ )
+ world.browser = webdriver.Firefox(firefox_binary=binary)
+ world.browser.implicitly_wait(2)
@before.all
def set_up_user():
@@ -125,6 +129,7 @@ def see_header(step, text):
@step(u'I am redirected to login')
def i_am_redirected_to_login(step):
# URL is correct....
+ time.sleep(1)
assert world.browser.current_url.split("?")[0] == django_url("/accounts/login/"), "Expected %s, got %s" % (django_url("/accounts/login/"), world.browser.current_url.split("?")[0])
# ... and login form exists (e.g. page rendered properly)
world.browser.find_element_by_class_name('login-form')
@@ -158,6 +163,7 @@ def i_login_as(step, username, password):
def i_click_the_button(step, value):
el = world.browser.find_element_by_xpath('//input[@value="%s"]' % value)
el.click()
+ time.sleep(1)
@step(u'I click the submit button')
def i_click_the_submit_button(step):
@@ -7,8 +7,8 @@
@step('I type "([^"]*)" in the user search form')
def i_type_text_in_the_user_search_form(step, text):
- el = css(".user-chooser-trigger")
time.sleep(0.5)
+ el = css(".user-chooser-trigger")
el.send_keys(text[0])
time.sleep(0.5)
el = css(".user-search")
@@ -26,6 +26,7 @@ def i_click_the_first_user_choice(step):
@step('I search for the user "([^"]*)"')
def i_search_for_the_user(step, text):
+ world.browser.get(django_url("/moderation/"))
world.browser.get(django_url("/moderation/#/users"))
i_type_text_in_the_user_search_form(step, text)
@@ -1,4 +1,4 @@
-from celery.decorators import task
+from celery.task import task
from correspondence.models import Mailing, Letter
@@ -213,3 +213,4 @@
MAX_READY_TO_PUBLISH_DAYS = 3
PUBLISHING_HOURS = (7, 23)
+SELENIUM_FIREFOX_BIN = "/usr/bin/firefox"
@@ -126,3 +126,4 @@
}
}
+SELENIUM_FIREFOX_BIN = "/home/tc1/src/firefox/firefox"
View
@@ -32,7 +32,6 @@
preexec_fn=os.setsid)
return_code = 0
-
if runtests:
try:
collectstatic = subprocess.Popen(
@@ -1,12 +1,10 @@
-django>=1.3.1
+django==1.4
psycopg2==2.4.1
-e hg+http://bitbucket.org/ubernostrum/django-registration#egg=django-registration
# Require celery 2.2 because of backwards incompatibility introduced in 2.3 --
# upgrade when resolved.
-Celery<2.3
-django-celery<2.3
-# Require python-dateutil 1.5 due to this issue: https://groups.google.com/group/celery-users/browse_thread/thread/08f754dbba35d1f4/b2587c10d65c64e3?lnk=raot
-python-dateutil==1.5
+Celery
+django-celery
pyPdf
PIL
amqplib
@@ -24,3 +22,4 @@ South
pyyaml
django-debug-toolbar
reportlab
+selenium<=2.20 # Due to this bug: https://code.google.com/p/selenium/issues/detail?id=3736
@@ -17,7 +17,7 @@
from django.contrib.auth.models import User
from django.conf import settings
-from celery.decorators import task
+from celery.task import task
from sorl.thumbnail import get_thumbnail
from scanning.models import Scan, ScanPage, Document, DocumentPage, EditLock
@@ -15,6 +15,7 @@ class btb.DocumentList extends btb.FilteredPaginatedCollection
class btb.EditDocumentManager extends Backbone.View
template: _.template $("#editDocumentsManager").html()
+
initialize: (options=documents: []) ->
@documents = new btb.DocumentList
@documents.filter.idlist = options.documents.join(".")
@@ -329,15 +330,14 @@ class btb.EditDocumentPageView extends Backbone.View
'click .move-page-up': 'movePageUp'
'click .move-page-down': 'movePageDown'
'click .crop': 'crop'
- 'click .highlight': 'highlight'
+ 'click .highlight': 'highlightMe'
'mousemove .page-image': 'mouseMove'
'mousedown .page-image': 'mouseDown'
grabMargin: 4
scale: 1
initialize: (options=page: null, pagecount: 1) ->
- @highlight = null
@page = options.page
@page.transformations = @page.transformations or {}
@pagecount = options.pagecount
@@ -351,6 +351,9 @@ class btb.EditDocumentPageView extends Backbone.View
if @mouseIsDown
@mouseUp(event)
+ highlightMe: =>
+ @setHighlighting(not @highlighting)
+
render: =>
$(@el).html @template(page: @page, pagecount: @pagecount)
@canvas = $(".page-image", @el)[0]
@@ -460,6 +463,7 @@ class btb.EditDocumentPageView extends Backbone.View
@trigger "movePageDown"
crop: => @setCropping(not @cropping)
+
setCropping: (cropping, trigger=true) =>
@cropping = cropping
if @cropping
@@ -468,7 +472,7 @@ class btb.EditDocumentPageView extends Backbone.View
if trigger
@trigger "cropping", @cropping
- highlight: => @setHighlighting(not @highlighting)
+
setHighlighting: (highlighting, trigger=true) =>
@highlighting = highlighting
if @highlighting

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -3,8 +3,6 @@
#
class btb.Scan extends Backbone.Model
url: -> btb.ScanList.prototype.baseUrl + "/" + @id
- parse: (response) ->
- response.results[0]
class btb.ScanList extends btb.FilteredPaginatedCollection
model: btb.Scan

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit c4fb1bb

Please sign in to comment.