fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-03-03 06:12 am

[dw-free] feed-atom.t fails when SITENAMEABBREV is not DW

[commit: http://hg.dwscoalition.org/dw-free/rev/b097a4f441a9]

http://bugs.dwscoalition.org/show_bug.cgi?id=3556

Fix test, don't hardcode value.

Patch by [personal profile] kareila.

Files modified:
  • t/feed-atom.t
--------------------------------------------------------------------------------
diff -r 08e9451d3370 -r b097a4f441a9 t/feed-atom.t
--- a/t/feed-atom.t	Tue Mar 01 09:25:31 2011 -0600
+++ b/t/feed-atom.t	Thu Mar 03 14:09:21 2011 +0800
@@ -14,6 +14,7 @@ my $remote = $u;
 my $remote = $u;
 my $r = DW::Request::Standard->new(
             HTTP::Request->new( GET => $u->journal_base . "/data/atom" ) );
+my $site_ns = lc $LJ::SITENAMEABBREV;
 
 
 note( "Empty feed" );
@@ -38,8 +39,8 @@ my $e2 = $u->t_post_fake_entry;
     delete $parsed->{Kids};
     is_deeply( $parsed,
         {
-            'xmlns'     => "http://www.w3.org/2005/Atom",
-            'xmlns:dw'  => $LJ::SITEROOT
+            'xmlns'          => "http://www.w3.org/2005/Atom",
+            "xmlns:$site_ns" => $LJ::SITEROOT,
         }, "Check namespaces for feed" );
 
     my ( $feed, $error ) = LJ::ParseFeed::parse_feed( $feed_xml, "atom" );
@@ -121,10 +122,10 @@ note( "No bot crawling" );
     delete $parsed->{Kids};
     is_deeply( $parsed,
         {
-            'xmlns'     => "http://www.w3.org/2005/Atom",
-            'xmlns:dw'  => $LJ::SITEROOT,
-            'xmlns:idx' => 'urn:atom-extension:indexing',
-            'idx:index' => 'no',
+            'xmlns'          => "http://www.w3.org/2005/Atom",
+            "xmlns:$site_ns" => $LJ::SITEROOT,
+            'xmlns:idx'      => 'urn:atom-extension:indexing',
+            'idx:index'      => 'no',
         }, "Atom indexing extension" );
 
     my ( $feed, $error ) = LJ::ParseFeed::parse_feed( $feed_xml, "atom" );
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org